/* ===== @morginfp Redeem — Design System ===== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Primary Palette — Electric Violet */
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;
  --primary-300: #c4b5fd;
  --primary-400: #a78bfa;
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-800: #5b21b6;
  --primary-900: #4c1d95;

  /* Neutrals */
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #09090b;

  /* Semantic */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Light theme */
  --bg: #f8f7ff;
  --bg-subtle: #f0eeff;
  --surface: #ffffff;
  --surface-border: rgba(139, 92, 246, 0.1);
  --surface-hover: #faf8ff;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --glow-color: rgba(109, 40, 217, 0.15);
  --glow-color-strong: rgba(139, 92, 246, 0.25);
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border: rgba(139, 92, 246, 0.08);
  --input-bg: #ffffff;
  --input-border: var(--gray-200);
  --input-focus: var(--primary-500);
  --footer-bg: #0d0118;
  --footer-text: rgba(255, 255, 255, 0.6);
  --badge-bg: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  --stepper-inactive-bg: var(--gray-200);
  --stepper-inactive-text: var(--gray-500);
  --stepper-line: var(--gray-200);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(139, 92, 246, 0.06);
  --btn-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --btn-gradient-hover: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  --btn-activate-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #4c1d95 100%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Theme --- */
html.dark {
  --bg: #0d0118;
  --bg-subtle: #150225;
  --surface: rgba(25, 10, 50, 0.7);
  --surface-border: rgba(139, 92, 246, 0.15);
  --surface-hover: rgba(30, 15, 60, 0.8);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --glow-color: rgba(109, 40, 217, 0.2);
  --glow-color-strong: rgba(139, 92, 246, 0.35);
  --header-bg: rgba(13, 1, 24, 0.85);
  --header-border: rgba(139, 92, 246, 0.12);
  --input-bg: rgba(20, 8, 40, 0.6);
  --input-border: rgba(139, 92, 246, 0.2);
  --input-focus: var(--primary-400);
  --stepper-inactive-bg: rgba(139, 92, 246, 0.15);
  --stepper-inactive-text: var(--gray-400);
  --stepper-line: rgba(139, 92, 246, 0.2);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(139, 92, 246, 0.08);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.dark {
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

/* --- Background Glow Effect --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, var(--glow-color-strong) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 0%, var(--glow-color) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, var(--glow-color-strong) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 0% 100%, var(--glow-color) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 100% 100%, var(--glow-color) 0%, transparent 50%);
  transition: background var(--transition-slow);
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--header-border);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--primary-500);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--glow-color);
}

.nav-link.active {
  color: var(--primary-600);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2.5px;
  border-radius: var(--radius-full);
  background: var(--primary-500);
}

html.dark .nav-link.active {
  color: var(--primary-400);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  font-size: 0.85rem;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--glow-color);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.lang-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* --- Main Content --- */
.main {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.dark .page-title {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* --- Stepper --- */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  padding: 0 4px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-base);
  position: relative;
}

.step-indicator.active {
  background: var(--btn-gradient);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 4px 12px rgba(139, 92, 246, 0.3);
}

.step-indicator.completed {
  background: var(--btn-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.step-indicator.inactive {
  background: var(--stepper-inactive-bg);
  color: var(--stepper-inactive-text);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--stepper-line);
  margin: 0 4px;
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
  position: relative;
  overflow: hidden;
}

.step-line.completed {
  background: var(--primary-500);
}

.step-line.completed::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  animation: lineShimmer 2s ease-in-out infinite;
}

@keyframes lineShimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- Card --- */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  margin-bottom: 16px;
}

.card-section {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--surface-border);
}

.card-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.section-links {
  display: flex;
  gap: 12px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--primary-500);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.section-link:hover {
  color: var(--primary-400);
}

.section-link svg {
  width: 14px;
  height: 14px;
}

/* --- Form Elements --- */
.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Prevent iOS zoom on input focus */
@supports (-webkit-touch-callout: none) {
  .input {
    font-size: 16px;
  }
}

.textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

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

.textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Prevent iOS zoom on input focus */
@supports (-webkit-touch-callout: none) {
  .textarea {
    font-size: 16px;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.btn-primary {
  background: var(--btn-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  background: var(--btn-gradient-hover);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.3);
}

.btn-activate {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--btn-activate-gradient);
  background-size: 200% 100%;
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn-activate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s ease;
}

.btn-activate:hover::before {
  left: 100%;
}

.btn-activate:hover {
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.btn-activate:active {
  transform: translateY(0);
}

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

.btn-activate:disabled::before {
  display: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* --- Warning Note --- */
.warning-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.warning-note svg {
  width: 18px;
  height: 18px;
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- Status Messages --- */
.status-msg {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 10px;
  animation: fadeSlide 0.3s ease;
}

.status-msg.show {
  display: flex;
}

.status-msg.success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-msg.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-msg svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 40px 24px 28px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-slogan {
  font-size: 0.8rem;
  opacity: 0.5;
}

.footer-links {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.footer-link {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.footer-copy {
  font-size: 0.75rem;
  opacity: 0.35;
  margin-top: 8px;
}

/* --- Responsive --- */

/* Tablet: 768px and below */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    padding: 0 18px;
    height: 52px;
  }

  .logo {
    font-size: 1rem;
    gap: 6px;
  }

  .logo-badge {
    padding: 2px 6px;
    font-size: 0.6rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .main {
    padding: 32px 18px 48px;
    max-width: 100%;
  }

  .page-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 28px;
  }

  .stepper {
    margin-bottom: 24px;
    padding: 0 2px;
  }

  .step-indicator {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .step-indicator.active {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 4px 12px rgba(139, 92, 246, 0.3);
  }

  .card {
    padding: 24px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
  }

  .card-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .section-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .section-link {
    font-size: 0.78rem;
    padding: 4px 8px;
  }

  .input-row {
    gap: 8px;
  }

  .input {
    padding: 11px 14px;
    font-size: 0.86rem;
  }

  .textarea {
    min-height: 90px;
    padding: 12px 14px;
    font-size: 0.84rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.86rem;
  }

  .btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .btn-activate {
    padding: 14px;
    font-size: 0.95rem;
  }

  .warning-note {
    padding: 12px 14px;
    font-size: 0.8rem;
    gap: 8px;
  }

  .footer-inner {
    gap: 12px;
  }

  .footer-links {
    gap: 16px;
  }
}

/* Mobile: 640px and below */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    padding: 0 14px;
    height: 48px;
  }

  .logo {
    font-size: 0.95rem;
    gap: 5px;
  }

  .logo-badge {
    padding: 2px 5px;
    font-size: 0.55rem;
    font-weight: 700;
  }

  .nav {
    gap: 2px;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
  }

  .nav-link.active::after {
    bottom: -10px;
    width: 20px;
    height: 2px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .main {
    padding: 20px 14px 40px;
    margin: 0 auto;
  }

  .page-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 6px;
  }

  .page-subtitle {
    font-size: 0.85rem;
    margin-bottom: 24px;
  }

  .stepper {
    margin-bottom: 20px;
    padding: 0;
    gap: 8px;
  }

  .step-indicator {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .step-indicator.active {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2), 0 2px 8px rgba(139, 92, 246, 0.25);
  }

  .step-line {
    flex: 1;
    height: 2px;
    margin: 0 4px;
  }

  .card {
    padding: 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
  }

  .card-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .card-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .section-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .section-desc {
    font-size: 0.78rem;
    margin-bottom: 12px;
    line-height: 1.5;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .section-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 8px 10px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary-500);
    font-weight: 500;
    transition: all var(--transition-fast);
  }

  .section-link:active {
    background: rgba(139, 92, 246, 0.12);
    transform: scale(0.98);
  }

  .section-link svg {
    width: 13px;
    height: 13px;
  }

  /* Form Elements */
  .input-row {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .input {
    padding: 11px 13px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    border-radius: 8px;
    min-height: 44px;
  }

  .input::placeholder {
    font-size: 0.82rem;
  }

  .textarea {
    padding: 11px 13px;
    font-size: 0.82rem;
    min-height: 80px;
    border-radius: 8px;
    min-height: 44px;
  }

  /* Buttons */
  .btn {
    padding: 11px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    min-height: 44px;
    min-width: 44px;
    gap: 6px;
  }

  .btn-primary {
    width: 100%;
  }

  .btn-primary:active {
    transform: scale(0.98);
  }

  .btn-sm {
    padding: 9px 12px;
    font-size: 0.75rem;
  }

  .btn-activate {
    width: 100%;
    padding: 13px;
    font-size: 0.9rem;
    border-radius: 10px;
    min-height: 48px;
  }

  .btn-activate svg {
    width: 18px;
    height: 18px;
  }

  .btn-row {
    justify-content: stretch;
  }

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

  /* Status Messages */
  .status-msg {
    padding: 9px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 8px;
    border-radius: 8px;
    gap: 6px;
  }

  .status-msg svg {
    width: 14px;
    height: 14px;
    min-width: 14px;
  }

  /* Warning Note */
  .warning-note {
    padding: 10px 12px;
    font-size: 0.77rem;
    gap: 8px;
    margin-top: 16px;
    border-radius: 8px;
  }

  .warning-note svg {
    width: 16px;
    height: 16px;
    margin-top: 0;
  }

  /* Footer */
  .footer {
    padding: 28px 14px 20px;
  }

  .footer-inner {
    gap: 8px;
  }

  .footer-logo {
    font-size: 0.95rem;
  }

  .footer-slogan {
    font-size: 0.75rem;
  }

  .footer-links {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-link {
    font-size: 0.75rem;
  }

  .footer-copy {
    font-size: 0.7rem;
  }
}

/* Small Mobile: 480px and below */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .header-inner {
    padding: 0 12px;
    height: 44px;
    gap: 8px;
  }

  .logo {
    font-size: 0.9rem;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 5px 8px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .main {
    padding: 16px 12px 32px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .page-subtitle {
    font-size: 0.8rem;
    margin-bottom: 20px;
  }

  .stepper {
    margin-bottom: 16px;
  }

  .step-indicator {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  .card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .card-section {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }

  .section-desc {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  .section-link {
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .input {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .textarea {
    padding: 10px 12px;
    font-size: 0.8rem;
    min-height: 75px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 0.75rem;
  }

  .btn-activate {
    padding: 12px;
    font-size: 0.85rem;
  }

  .warning-note {
    padding: 8px 10px;
    font-size: 0.73rem;
    gap: 6px;
  }

  .footer {
    padding: 20px 12px 16px;
  }

  .footer-logo {
    font-size: 0.9rem;
  }

  .footer-links {
    gap: 10px;
  }

  .footer-link {
    font-size: 0.7rem;
  }
}

/* Portrait orientation adjustment */
@media (orientation: portrait) and (max-width: 768px) {
  .input-row {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
  }
}

/* --- Pulse animation for active step --- */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 4px 12px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.1), 0 4px 12px rgba(139, 92, 246, 0.2); }
}

.step-indicator.active {
  animation: pulse 2.5s ease-in-out infinite;
}

/* --- Checkmark for completed steps --- */
.step-indicator.completed::after {
  content: '✓';
  font-size: 0.9rem;
}

.step-indicator.completed span {
  display: none;
}

/* --- Section disabled state --- */
.card-section.disabled {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* --- Smooth transitions for theme change --- */
.header,
.card,
.input,
.textarea,
.btn,
.footer,
.step-indicator,
.step-line {
  transition-property: background, color, border-color, box-shadow, opacity;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
