/* ==========================================================================
   Project Discovery Questionnaire — Design System
   Minimal, enterprise, Apple/Stripe/Linear-inspired.
   Supports RTL (Arabic) / LTR (English) and Light / Dark mode.
   ========================================================================== */

:root {
  /* Color palette — light mode */
  --color-bg: #ffffff;
  --color-bg-subtle: #fafafa;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-border: #e8e8ec;
  --color-border-strong: #d8d8de;
  --color-text: #1a1a1e;
  --color-text-secondary: #6b6b76;
  --color-text-tertiary: #9a9aa4;
  --color-accent: #3d6bf5;
  --color-accent-hover: #2f57d6;
  --color-accent-subtle: #eef2ff;
  --color-success: #1f9d5a;
  --color-success-subtle: #e9f9f0;
  --color-error: #e5484d;
  --color-error-subtle: #fef2f2;
  --color-overlay: rgba(20, 20, 24, 0.45);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.04), 0 1px 1px rgba(20, 20, 30, 0.03);
  --shadow-md: 0 4px 16px rgba(20, 20, 30, 0.06), 0 1px 3px rgba(20, 20, 30, 0.04);
  --shadow-lg: 0 12px 40px rgba(20, 20, 30, 0.10), 0 2px 8px rgba(20, 20, 30, 0.05);
  --shadow-focus: 0 0 0 4px var(--color-accent-subtle);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Type */
  --font-sans: "Inter", "SF Pro Display", "Segoe UI", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-sans-ar: "Inter", "IBM Plex Sans Arabic", "Segoe UI", "Tahoma", sans-serif;

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 420ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0d0d10;
    --color-bg-subtle: #131316;
    --color-surface: #17171b;
    --color-surface-raised: #1c1c21;
    --color-border: #2a2a30;
    --color-border-strong: #38383f;
    --color-text: #f2f2f4;
    --color-text-secondary: #a3a3ad;
    --color-text-tertiary: #6f6f7a;
    --color-accent: #6d8dff;
    --color-accent-hover: #86a0ff;
    --color-accent-subtle: rgba(109, 141, 255, 0.14);
    --color-success: #3ecf7e;
    --color-success-subtle: rgba(62, 207, 126, 0.12);
    --color-error: #f56b70;
    --color-error-subtle: rgba(245, 107, 112, 0.12);
    --color-overlay: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  }
}

html.dark {
  color-scheme: dark;
  --color-bg: #0d0d10;
  --color-bg-subtle: #131316;
  --color-surface: #17171b;
  --color-surface-raised: #1c1c21;
  --color-border: #2a2a30;
  --color-border-strong: #38383f;
  --color-text: #f2f2f4;
  --color-text-secondary: #a3a3ad;
  --color-text-tertiary: #6f6f7a;
  --color-accent: #6d8dff;
  --color-accent-hover: #86a0ff;
  --color-accent-subtle: rgba(109, 141, 255, 0.14);
  --color-success: #3ecf7e;
  --color-success-subtle: rgba(62, 207, 126, 0.12);
  --color-error: #f56b70;
  --color-error-subtle: rgba(245, 107, 112, 0.12);
  --color-overlay: rgba(0, 0, 0, 0.6);
}

html.light {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-bg-subtle: #fafafa;
  --color-surface: #ffffff;
  --color-surface-raised: #ffffff;
  --color-border: #e8e8ec;
  --color-border-strong: #d8d8de;
  --color-text: #1a1a1e;
  --color-text-secondary: #6b6b76;
  --color-text-tertiary: #9a9aa4;
  --color-accent: #3d6bf5;
  --color-accent-hover: #2f57d6;
  --color-accent-subtle: #eef2ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--color-bg-subtle);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

html[dir="rtl"] body {
  font-family: var(--font-sans-ar);
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

/* -------------------------------------------------------------------------
   Layout shell
   ------------------------------------------------------------------------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--color-border);
}

.top-bar-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
}

.icon-btn:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.icon-btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-color: var(--color-accent);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
}

.lang-toggle:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

main.wizard {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) var(--space-4) var(--space-9);
}

.wizard-inner {
  width: 100%;
  max-width: 720px;
}

/* -------------------------------------------------------------------------
   Progress bar
   ------------------------------------------------------------------------- */

.progress-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto var(--space-6);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.progress-track {
  position: relative;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  transition: width var(--duration-slow) var(--ease-standard);
}

/* -------------------------------------------------------------------------
   Cards / panels
   ------------------------------------------------------------------------- */

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-7) var(--space-6);
}

@media (max-width: 640px) {
  .panel {
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-md);
  }
}

.panel-header {
  margin-bottom: var(--space-6);
}

.panel-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 var(--space-2);
}

.panel-title {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-text);
}

.panel-subtitle {
  margin: var(--space-2) 0 0;
  color: var(--color-text-secondary);
  font-size: 15px;
}

/* -------------------------------------------------------------------------
   Welcome screen
   ------------------------------------------------------------------------- */

.welcome-screen {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.welcome-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-6);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--color-accent), var(--color-accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}

.welcome-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0 auto var(--space-5);
}

.welcome-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-7);
}

/* -------------------------------------------------------------------------
   Form elements
   ------------------------------------------------------------------------- */

.field-group {
  margin-bottom: var(--space-5);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

label,
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.field-label .optional-tag {
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: none;
  letter-spacing: 0;
}

.field-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-standard);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

textarea.expandable {
  min-height: 140px;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-tertiary);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-border-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) center;
  padding-inline-end: 40px;
  cursor: pointer;
}

html[dir="rtl"] select {
  background-position: 14px center;
}

.field-error {
  display: none;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-error);
  font-size: 13px;
  font-weight: 500;
  margin-top: var(--space-2);
  animation: shakeIn var(--duration-base) var(--ease-standard);
}

.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea {
  border-color: var(--color-error);
  background: var(--color-error-subtle);
}

.field-group.has-error .field-error {
  display: flex;
}

@keyframes shakeIn {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Choice chips (radio / checkbox styled as pills) */
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choice-chip {
  position: relative;
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice-chip label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  user-select: none;
}

.choice-chip label:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.choice-chip input:checked + label {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.choice-chip input:focus-visible + label {
  box-shadow: var(--shadow-focus);
}

/* Card-style radio for bigger choices (yes/no, pbx type) */
.option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.option-card {
  position: relative;
}

.option-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.option-card label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
}

.option-card input:checked + label {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.option-card input:focus-visible + label {
  box-shadow: var(--shadow-focus);
}

/* Conditional reveal blocks */
.conditional-block {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--duration-slow) var(--ease-standard),
    opacity var(--duration-base) var(--ease-standard);
}

.conditional-block.is-visible {
  max-height: 600px;
  opacity: 1;
  margin-top: var(--space-4);
}

/* -------------------------------------------------------------------------
   File upload
   ------------------------------------------------------------------------- */

.dropzone {
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  background: var(--color-bg-subtle);
  transition: all var(--duration-fast) var(--ease-standard);
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-icon {
  margin: 0 auto var(--space-3);
  color: var(--color-text-tertiary);
}

.dropzone-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.dropzone-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.file-list {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  animation: fadeSlideIn var(--duration-base) var(--ease-standard);
}

.file-item-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-remove {
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.file-item-remove:hover {
  color: var(--color-error);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-6);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard),
    opacity var(--duration-fast) var(--ease-standard);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
  height: 40px;
  padding: 0 var(--space-4);
}

.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-bg-subtle);
}

.btn-lg {
  height: 56px;
  padding: 0 var(--space-7);
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-7);
  gap: var(--space-3);
}

.nav-row .spacer {
  flex: 1;
}

/* -------------------------------------------------------------------------
   Review screen
   ------------------------------------------------------------------------- */

.review-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--color-bg-subtle);
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.review-card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--color-text);
  margin: 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.review-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.review-item-value {
  font-size: 14px;
  color: var(--color-text);
  word-break: break-word;
}

.review-item-value.empty {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* -------------------------------------------------------------------------
   Success screen
   ------------------------------------------------------------------------- */

.success-screen {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.success-check {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-6);
  border-radius: 50%;
  background: var(--color-success-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-check svg {
  width: 44px;
  height: 44px;
}

.success-check circle {
  stroke: var(--color-success);
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: drawCircle 0.6s var(--ease-standard) forwards;
}

.success-check path {
  stroke: var(--color-success);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawCheck 0.4s var(--ease-standard) 0.5s forwards;
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.success-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 var(--space-3);
}

.success-message {
  color: var(--color-text-secondary);
  font-size: 16px;
  margin: 0 0 var(--space-6);
}

.success-list {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: start;
  margin: 0 auto var(--space-7);
  padding: var(--space-5) var(--space-6);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.success-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.success-list-item .check-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-success-subtle);
  color: var(--color-success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.success-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Screen transitions
   ------------------------------------------------------------------------- */

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn var(--duration-slow) var(--ease-standard);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------------------------------
   Toast (submission errors, etc.)
   ------------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-surface-raised);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-base) var(--ease-standard);
  max-width: 90vw;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

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

/* -------------------------------------------------------------------------
   Resume-session modal
   ------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.modal-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  max-width: 420px;
  width: 100%;
  text-align: center;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--duration-base) var(--ease-standard);
}

.modal-overlay.is-visible .modal-box {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.modal-body {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-5);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* -------------------------------------------------------------------------
   Loading spinner (submit button state)
   ------------------------------------------------------------------------- */

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

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

/* -------------------------------------------------------------------------
   Utility
   ------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-6) 0;
  border: none;
}
