@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0a1628;
  --teal: #2b5e7d;
  --teal-dark: #1e4a63;
  --gold: #c9a227;
  --bg: #f4f6f9;
  --bg-alt: #e8eef4;
  --card: #ffffff;
  --border: #d4dde8;
  --muted: #5a7d9a;
  --success: #2d6a4f;
  --danger: #b91c1c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow: 0 20px 60px rgba(10, 22, 40, 0.16);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(201, 162, 39, 0.1), transparent 55%),
    radial-gradient(800px 480px at 88% 92%, rgba(43, 94, 125, 0.14), transparent 60%),
    linear-gradient(160deg, #0a1628 0%, #152238 42%, #1e3a52 100%);
  min-height: 100vh;
  color: var(--navy);
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: 100%;
  max-width: 640px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Compact header — logo left, title right */
.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.brand-logo {
  flex-shrink: 0;
}

.brand-logo img {
  display: block;
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}

.header-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.badge-lwu {
  display: inline-block;
  background: rgba(43, 94, 125, 0.1);
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.card-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.card-header p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-top: 4px;
}

.card-body { padding: 24px; }

.info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.55;
  margin-bottom: 20px;
  color: #334155;
}

.info-box a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

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

.step { display: none; }
.step.active { display: block; }

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin: 18px 0 10px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  margin-bottom: 6px;
  color: var(--navy);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg-alt);
  color: var(--navy);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(43, 94, 125, 0.12);
  background: #fff;
}

.form-group input.input-readonly,
.form-group select:disabled {
  background: var(--bg);
  color: var(--navy);
  cursor: default;
  border-color: var(--border);
  box-shadow: none;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.74rem;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 12px rgba(10, 22, 40, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 22, 40, 0.3);
}

.btn-primary:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--navy);
  border: 1px solid var(--border);
  margin-top: 10px;
  width: 100%;
}

.btn-secondary:hover {
  background: var(--bg);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 16px;
  display: none;
}

.alert.show { display: block; }
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.profile-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}

.profile-item .label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.profile-item .value {
  font-weight: 600;
  font-size: 0.84rem;
  margin-top: 2px;
  word-break: break-word;
  color: var(--navy);
}

.doc-note {
  display: none;
  font-size: 0.82rem;
  color: var(--success);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #ecfdf5;
  border-radius: 8px;
  border: 1px solid #a7f3d0;
}

.doc-note.show { display: block; }

.doc-list {
  list-style: none;
  margin-bottom: 18px;
  max-height: 220px;
  overflow-y: auto;
}

.doc-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.doc-list li .doc-name {
  font-weight: 500;
  color: var(--navy);
}

.doc-list li .doc-tag {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.doc-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 8px;
  flex-shrink: 0;
}

.muted-text {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 14px;
}

.doc-blocked {
  color: #9a3412;
  background: #fff7ed;
  border-left: 3px solid #ea580c;
  padding: 10px 12px;
  border-radius: 6px;
}

.doc-blocked-note {
  color: #9a3412;
  font-size: 0.84rem;
  margin: 0 0 12px;
}

.submit-blocked .confirm-group,
.submit-blocked #submitBtn {
  opacity: 0.55;
  pointer-events: none;
}

.confirm-group { margin: 14px 0; }

.confirm-group label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
  cursor: pointer;
  color: #334155;
}

.confirm-group a {
  color: var(--teal);
  font-weight: 600;
}

.confirm-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: var(--teal);
}

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

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

.footer-links {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.footer-links a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover { text-decoration: underline; color: var(--teal-dark); }

.success-body {
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 16px;
  color: #334155;
}

.shell-guide { max-width: 760px; }

.guide-body { padding: 24px 28px 28px; }

.guide-section {
  margin-bottom: 28px;
}

.guide-section h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.guide-section p,
.guide-note {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #334155;
  margin-bottom: 10px;
}

.guide-list,
.guide-steps {
  margin: 0 0 10px 1.15rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #334155;
}

.guide-list li,
.guide-steps li { margin-bottom: 6px; }

.guide-steps li strong,
.guide-list li strong { color: var(--navy); }

.guide-note {
  background: #f8fafc;
  border-left: 3px solid var(--teal);
  padding: 10px 12px;
  border-radius: 6px;
}

.guide-faq h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin: 14px 0 6px;
}

.guide-faq p {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 4px;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 20px;
}

.guide-section a {
  color: var(--teal);
  font-weight: 600;
}

@media (max-width: 640px) {
  body { padding: 16px 12px; }
  .card-header {
    flex-direction: column;
    text-align: center;
    padding: 18px 16px;
  }
  .header-text { text-align: center; }
  .brand-logo img {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
  }
  .form-row, .profile-grid { grid-template-columns: 1fr; }
  .card-body { padding: 18px 16px 20px; }
  .guide-body { padding: 18px 16px 20px; }
  .guide-actions { flex-direction: column; }
  .guide-actions .btn { width: 100%; text-align: center; }
  .doc-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
