:root {
  --primary-color: #16a34a;
  --primary-hover: #15803d;
  --accent-color: #22c55e;
  --bg-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.82);
  --text-color: #0f172a;
  --text-muted: #64748b;
  --input-bg: #ffffff;
  --border-color: rgba(226, 232, 240, 0.8);
  --focus-ring: rgba(22, 163, 74, 0.16);
  --radius-card: 24px;
  --radius-input: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Toast Notification Base */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: var(--radius-input);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 20px 25px -5px rgba(15, 23, 42, 0.08),
    0 8px 10px -6px rgba(15, 23, 42, 0.04);
  color: var(--text-color);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition:
    opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.3s;
  overflow: hidden;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Toast Icon & Content */
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: calc(var(--radius-input) - 4px);
}

.toast-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-color);
}

.toast-message {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}


/* Close Button */
.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 8px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  align-self: center; /* Centers vertically relative to content */
}

.toast-close:hover {
  color: var(--text-color);
  background: rgba(15, 23, 42, 0.06);
}

.toast-close:focus-visible {
  box-shadow: 0 0 0 2px var(--primary-color);
}

/* Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
}

.toast.show .toast-progress {
  animation: toastProgress 4000ms linear forwards;
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Success Variant */
.toast.success {
  border-color: rgba(22, 163, 74, 0.3);
}
.toast.success .toast-icon {
  background: var(--focus-ring);
  color: var(--primary-color);
}
.toast.success .toast-progress {
  background: var(--accent-color);
}

/* Error Variant */
.toast.error {
  border-color: rgba(239, 68, 68, 0.3);
}
.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.toast.error .toast-progress {
  background: #ef4444;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .toast {
    bottom: 16px;
    left: 16px;
    right: 16px;
    min-width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Background layers ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(22, 163, 74, 0.08),
      transparent 45%
    ),
    radial-gradient(circle at 85% 80%, rgba(34, 197, 94, 0.1), transparent 45%),
    var(--bg-color);
}

.grid-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    #000 40%,
    transparent 100%
  );
}

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -2;
  pointer-events: none;
  will-change: transform;
}

.blob-1 {
  width: 380px;
  height: 380px;
  background: rgba(22, 163, 74, 0.22);
  top: -100px;
  left: -100px;
  animation: float-a 16s ease-in-out infinite;
}

.blob-2 {
  width: 420px;
  height: 420px;
  background: rgba(34, 197, 94, 0.16);
  bottom: -120px;
  right: -100px;
  animation: float-b 19s ease-in-out infinite;
}

.blob-3 {
  width: 260px;
  height: 260px;
  background: rgba(187, 247, 208, 0.45);
  top: 45%;
  left: 55%;
  transform: translate(-50%, -50%);
  animation: float-c 14s ease-in-out infinite;
}

@keyframes float-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30px, 40px);
  }
}
@keyframes float-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-35px, -30px);
  }
}
@keyframes float-c {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-46%, -54%);
  }
}

/* ---------- Card ---------- */
.form-container {
  background-color: var(--card-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-card);
  padding: 44px 40px;
  width: 100%;
  max-width: 520px;
  box-shadow:
    0 1px 1px rgba(15, 23, 42, 0.02),
    0 10px 30px -8px rgba(15, 23, 42, 0.12),
    0 30px 60px -20px rgba(22, 163, 74, 0.15);
  border: 1px solid var(--border-color);
  animation: card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.18);
  color: var(--primary-hover);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  animation: fade-in 0.6s ease 0.1s both;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulse-dot 2.2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 12px;
  animation: fade-in 0.6s ease 0.16s both;
}

.header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  max-width: 380px;
  margin: 0 auto;
  animation: fade-in 0.6s ease 0.22s both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Form ---------- */
.form-group {
  margin-bottom: 18px;
  animation: fade-in 0.5s ease both;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  color: var(--text-color);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

input,
select {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 50px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease,
    transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

input:hover,
select:hover {
  border-color: #cbd5e1;
}

input:focus,
select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

input:focus + .input-icon,
select:focus ~ .input-icon {
  color: var(--primary-color);
}

.form-group:focus-within label {
  color: var(--primary-hover);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

select:invalid {
  color: #94a3b8;
}

select option {
  color: var(--text-color);
}

/* ---------- Button ---------- */
button {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius-input);
  background: linear-gradient(
    135deg,
    var(--accent-color),
    var(--primary-hover)
  );
  color: white;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  box-shadow:
    0 1px 2px rgba(21, 128, 61, 0.1),
    0 8px 20px -6px rgba(22, 163, 74, 0.45);
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(21, 128, 61, 0.12),
    0 14px 28px -6px rgba(22, 163, 74, 0.5);
  filter: brightness(1.04);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

button:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.35);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

button:disabled::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Footer ---------- */
.footer-note {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.footer-note .footer-primary {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 3px;
}

.footer-note .footer-secondary {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ---------- Focus / accessibility ---------- */
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .form-container {
    padding: 32px 22px;
    border-radius: 20px;
  }

  .header h1 {
    font-size: 1.6rem;
  }

  .header p {
    font-size: 0.875rem;
  }

  input,
  select,
  button {
    height: 52px;
    font-size: 0.9rem;
  }
}

@media (max-width: 340px) {
  .form-container {
    padding: 26px 16px;
  }
}
