/* ===== Design System — Zinc Dark ===== */
:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface2: #1f1f23;
  --surface3: #27272a;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.13);
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --primary: #a78bfa;
  --primary-dim: rgba(167,139,250,0.12);
  --primary-glow: rgba(167,139,250,0.2);
  --accent: #38bdf8;
  --accent-dim: rgba(56,189,248,0.1);
  --success: #22c55e;
  --success-dim: rgba(34,197,94,0.1);
  --error: #ef4444;
  --error-dim: rgba(239,68,68,0.1);
  --radius: 12px;
  --radius-sm: 9px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 8px;
  position: relative;
}

.hero-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: auto;
  opacity: 0.035;
  pointer-events: none;
  z-index: -1;
  filter: blur(0.5px);
}

.hero-wordmark {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ===== Service Cards ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 40px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  transition: all 0.2s ease;
}

.service-card:hover {
  border-color: var(--border-hover);
  background: var(--surface2);
}

.service-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
}

.service-card h3 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.service-card p {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

/* ===== Form ===== */
.form-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: -0.01em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

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

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

/* ===== Toggle ===== */
.toggle-group {
  display: flex;
  gap: 0;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.toggle-btn {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.toggle-btn.active {
  background: var(--surface3);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ===== Checkbox Cards ===== */
.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checkbox-card {
  display: block;
  cursor: pointer;
}

.checkbox-card input { display: none; }

.checkbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.15s ease;
  color: var(--text-secondary);
}

.checkbox-content:hover {
  border-color: var(--border-hover);
}

.checkbox-card input:checked + .checkbox-content {
  background: var(--primary-dim);
  border-color: rgba(167,139,250,0.3);
  color: var(--text);
}

.checkbox-icon {
  font-size: 1.2rem;
  color: var(--primary);
  transition: color 0.15s ease;
}

.checkbox-card input:checked + .checkbox-content .checkbox-icon {
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #0f0f11;
}

.btn-primary:hover {
  background: #b49bff;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-full { width: 100%; }

.btn-stack { margin-top: 12px; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.btn-sm {
  padding: 8px 12px;
  font-size: 0.78rem;
}

.link-button {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
}

.link-button:hover {
  color: var(--text-secondary);
}

.login-help {
  padding: 2px 0;
}

.login-notice {
  margin: 14px 0 0;
  padding: 11px 13px;
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.18);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.login-notice[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9,9,11,0.78);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-header .form-title {
  margin-bottom: 0;
  text-align: left;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface3);
}

/* ===== Member Dashboard ===== */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-heading {
  text-align: left;
  margin-bottom: 4px;
}

.dashboard-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.member-service-grid {
  display: grid;
  gap: 10px;
}

.member-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.member-service-on {
  border-color: rgba(34,197,94,0.22);
  background: var(--success-dim);
}

.member-service h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.member-service p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.service-launch {
  flex: 0 0 auto;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.service-launch-muted {
  color: var(--text-muted);
}

/* ===== Feedback ===== */
.form-error {
  color: var(--error);
  font-size: 0.8rem;
  margin-bottom: 12px;
  min-height: 20px;
}

.form-error:empty {
  display: none;
}

.form-success {
  background: var(--success-dim);
  border: 1px solid rgba(34,197,94,0.2);
  color: var(--success);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 500;
}

.form-success:empty {
  display: none;
}

/* ===== Info Box ===== */
.info-box {
  background: var(--primary-dim);
  border: 1px solid rgba(167,139,250,0.15);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.info-box h3 {
  font-size: 0.88rem;
  margin-bottom: 12px;
  color: var(--primary);
  font-weight: 600;
}

.info-box ol {
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.info-box a {
  color: var(--accent);
  text-decoration: none;
}

.info-box a:hover { text-decoration: underline; }

.info-box strong { color: var(--text); }

.back-link {
  text-align: center;
  margin-top: 18px;
}

.back-link a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
}

.back-link a:hover { color: var(--text-secondary); }

/* ===== Pirate Divider ===== */
.pirate-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 32px 0;
  color: var(--text-muted);
  opacity: 0.3;
}

.pirate-divider::before,
.pirate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.pirate-divider i {
  font-size: 0.7rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.footer i {
  margin: 0 2px;
  opacity: 0.5;
}

/* ===== Kindle Note ===== */
.kindle-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.kindle-note i {
  margin-right: 4px;
  color: var(--primary);
}

.kindle-note a {
  color: var(--accent);
  text-decoration: none;
}

.kindle-note a:hover { text-decoration: underline; }

/* ===== Step Indicators ===== */
.step-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #0f0f11;
}

.step-dot.completed {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

/* ===== Kindle Steps ===== */
.kindle-step {
  display: none;
  margin-bottom: 16px;
}

.kindle-step.active {
  display: block;
}

.step-content {
  margin-bottom: 24px;
}

.step-content > p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.step-options {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.step-option {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.step-option h4 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.step-option h4 i {
  color: var(--primary);
  margin-right: 6px;
  width: 16px;
  text-align: center;
}

.step-option ol {
  padding-left: 20px;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.step-option a {
  color: var(--accent);
  text-decoration: none;
}

.step-option a:hover { text-decoration: underline; }

.step-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.step-hint strong {
  color: var(--text-secondary);
  font-style: normal;
}

/* ===== Approved Sender Box ===== */
.approved-sender-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
}

.approved-sender-box code {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  font-family: inherit;
  letter-spacing: 0.01em;
}

.btn-copy {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}

.btn-copy:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.step-instructions ol {
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 2;
  color: var(--text-secondary);
}

.step-instructions a {
  color: var(--accent);
  text-decoration: none;
}

.step-instructions a:hover { text-decoration: underline; }

.step-instructions strong {
  color: var(--text);
}

/* ===== Reference Image ===== */
.reference-image {
  margin-top: 20px;
}

.ref-image-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.ref-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  opacity: 0.9;
}

/* ===== Step Navigation ===== */
.step-nav {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.step-nav-back {
  margin-top: 14px;
  text-align: center;
}

.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

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

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

/* ===== Success Page ===== */
.success-card {
  text-align: center;
  padding: 48px 32px;
}

.success-icon {
  margin-bottom: 16px;
}

.skeleton-thumb {
  width: 100px;
  height: auto;
}

.success-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.success-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeUp 0.4s ease-out forwards; }
.fade-in-d1 { animation-delay: 0.05s; opacity: 0; }
.fade-in-d2 { animation-delay: 0.1s; opacity: 0; }
.fade-in-d3 { animation-delay: 0.15s; opacity: 0; }

/* ===== Responsive ===== */
@media (max-width: 500px) {
  .container { padding: 32px 16px 64px; }
  .hero-title { font-size: 1.8rem; }
  .services-grid { grid-template-columns: 1fr; gap: 8px; }
  .service-card {
    display: flex; align-items: center; gap: 12px;
    text-align: left; padding: 16px;
  }
  .service-icon { font-size: 1.5rem; margin-bottom: 0; }
  .checkbox-group { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 24px 20px; border-radius: 14px; }
}
