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

:root {
  --brand:      #003f7f;
  --brand-dark: #002e5c;
  --brand-light:#e8f0fb;
  --text:       #1a1a1a;
  --muted:      #555;
  --border:     #d0d7de;
  --error-bg:   #fff0f0;
  --error-text: #c0392b;
  --success-bg: #f0fff4;
  --success-accent: #27ae60;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f9;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: var(--brand);
  color: #fff;
  padding: 14px 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.header-inner { display: flex; align-items: center; gap: 14px; max-width: 520px; margin: 0 auto; }
.logo-text { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.04em; }
.header-title { font-size: 1rem; font-weight: 400; opacity: 0.88; }

/* ── Main ── */
main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 32px 16px; }

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.tab {
  flex: 1;
  padding: 14px 0;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Panels ── */
.panel { padding: 28px 28px 24px; }
.panel-desc { font-size: 0.88rem; color: var(--muted); margin-bottom: 20px; }

/* ── Form fields ── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: var(--text);
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,63,127,0.12); }

/* ── Buttons ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 11px;
  margin-top: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.97rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #a0b4cc; cursor: not-allowed; }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: none;
  color: var(--brand);
  font-size: 0.93rem;
  font-weight: 600;
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--brand-light); }

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-group .btn-primary,
.btn-group .btn-outline {
  flex: 1;
  margin-top: 0;
}

.btn-outline {
  display: block;
  padding: 11px;
  background: none;
  color: var(--brand);
  font-size: 0.97rem;
  font-weight: 600;
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-outline:hover { background: var(--brand-light); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ── Error ── */
.error-msg {
  background: var(--error-bg);
  color: var(--error-text);
  border-left: 3px solid var(--error-text);
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

/* ── OTP hints ── */
.otp-hint { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.otp-timer { font-size: 0.83rem; color: var(--muted); margin-bottom: 18px; }

/* ── Result box ── */
.result-box {
  text-align: center;
  padding: 8px 0 4px;
}
.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-accent);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.result-title { font-size: 1.05rem; font-weight: 700; color: var(--success-accent); margin-bottom: 4px; }
.result-name { font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }

.password-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #f5f7fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 10px;
}
.password-text {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
}
.btn-copy {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-copy:hover { background: var(--brand-dark); }
.btn-copy.copied { background: var(--success-accent); }

.result-hint { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }

.access-list {
  list-style: none;
  text-align: left;
  margin: 12px 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.access-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}
.access-list li:last-child { border-bottom: none; }
.access-now  { background: #f0fff4; }
.access-later { background: #fffbf0; }

.access-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--success-accent);
  color: #fff;
  white-space: nowrap;
}
.access-badge.delayed {
  background: #e67e22;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: #aaa;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .panel { padding: 20px 16px 18px; }
  .password-text { font-size: 1.05rem; }
}
