/*
  UI fixes: minimal, non-global.
  - styles for header buttons in account/admin header blocks
  - does not override Tailwind utilities
*/

.section-header-menu > div {
  display: flex;
  align-items: center;
}

.back-to-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 25px;
  text-decoration: none;
  font-weight: 100;
  transition: background-color 0.3s, transform 0.12s ease-out, box-shadow 0.12s ease-out;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.back-to-menu-btn:not(:first-child) {
  margin-left: 10px;
}

.back-to-menu-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.back-to-menu-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Toast notifications */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--white);
  background: var(--agree);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  animation: toast-in 160ms ease-out;
}

.toast--leaving {
  animation: toast-out 140ms ease-in forwards;
}

.toast--info {
  background: var(--acception);
}

.toast--error {
  background: var(--primary-color);
}

.toast--warning {
  background: var(--accent-color);
}

.toast__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  margin-top: 1px;
  opacity: 0.95;
}

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.toast__text {
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-line;
}

.toast__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1;
  font-size: 18px;
  padding: 0;
  cursor: pointer;
  opacity: 0.9;
}

.toast__close:hover {
  opacity: 1;
}

.toast__bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.45);
  transform-origin: left;
  transform: scaleX(1);
  animation: toast-bar linear forwards;
  animation-duration: var(--toast-duration, 4500ms);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(0, -6px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -6px, 0) scale(0.98);
  }
}

@keyframes toast-bar {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
  .toast--leaving {
    animation: none;
  }
  .toast__bar {
    animation: none;
  }
}

@media (max-width: 480px) {
  .toast-stack {
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
  }
}

/* === Error pages (403/404/419) === */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-light);
}

.error-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 16px 70px;
}

.error-card {
  width: 100%;
  max-width: 720px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
  padding: 34px 36px;
}

.error-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.error-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--secondary-color);
}

.error-code {
  font-size: 14px;
  line-height: 1;
  font-family: var(--font-text);
  color: var(--light-text);
  opacity: 0.9;
}

.error-subtitle {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.6;
  font-family: var(--font-text);
  color: var(--text-color);
}

.error-details {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  font-family: var(--font-text);
  color: var(--light-text);
}

.error-actions {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.error-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--primary-color);
  color: var(--white);
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  border: 0;
  white-space: nowrap;
  transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.error-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.error-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.error-btn:focus-visible {
  outline: 3px solid rgba(219, 58, 52, 0.55);
  outline-offset: 3px;
}

/* Subtle ripple like donor buttons */
.error-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.error-btn:active::after {
  animation: error-ripple 420ms ease-out;
}

@keyframes error-ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) scale(22);
    opacity: 0;
  }
}

/* If buttons do not fit — stack immediately */
@media (max-width: 768px) {
  .error-actions {
    grid-template-columns: 1fr;
  }

  .error-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .error-card {
    padding: 26px 20px;
  }

  .error-title {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-btn {
    transition: none;
  }

  .error-btn:active::after {
    animation: none;
  }
}
