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

html {
  font-size: 18px;
}

body {
  font-family: Georgia, serif;
  background: #ffffff;
  color: #1e293b;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 32px 48px;
  border-bottom: 1px solid #e2e8f0;
  width: 100%;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: normal;
  letter-spacing: -0.5px;
  color: #1e293b;
  margin-bottom: 16px;
}

.hero-title span {
  color: #0369a1;
}

.hero-tagline {
  font-size: 1.2rem;
  color: #64748b;
  max-width: 580px;
}

.hide {
  display: none !important;
}

/* ── Page Content ────────────────────────────────────────── */
.page-content {
  flex: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 32px 80px;
  width: 100%;
}

.section-heading {
  font-size: 1rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #0369a1;
  margin-bottom: 16px;
}

.page-intro {
  font-size: 1.15rem;
  color: #475569;
  max-width: 680px;
  margin-bottom: 64px;
}

.page-intro strong {
  color: #1e293b;
}

/* ── Features ────────────────────────────────────────────── */
.features {
  display: grid;
  gap: 40px;
  margin-bottom: 72px;
}

.feature-heading {
  font-size: 1rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #0369a1;
  margin-bottom: 10px;
}

.feature-body {
  color: #475569;
  max-width: 620px;
}

.feature-body strong {
  color: #1e293b;
}

/* ── Setup Steps ─────────────────────────────────────────── */
.setup-steps {
  display: grid;
  gap: 20px;
  margin-bottom: 72px;
}

.setup-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-family: sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: normal;
  color: #1e293b;
  margin-bottom: 4px;
}

.step-content p {
  color: #475569;
  font-size: 0.95rem;
  max-width: 580px;
}

.step-content p strong {
  color: #1e293b;
}

/* ── CTA ─────────────────────────────────────────────────── */
.page-cta {
  border-top: 1px solid #e2e8f0;
  padding-top: 48px;
}

.page-cta p {
  color: #64748b;
  margin-bottom: 24px;
  font-size: 1rem;
}

.game-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-game {
  display: inline-block;
  padding: 14px 28px;
  background: #0369a1;
  color: #ffffff;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 4px;
  transition: background 0.15s;
}

.btn-game:hover {
  background: #0284c7;
}

/* ── Auth Page ───────────────────────────────────────────── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-heading {
  font-size: 1.8rem;
  font-weight: normal;
  color: #1e293b;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 40px;
  line-height: 1.5;
}

.auth-step {
  display: none;
}

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

.auth-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.auth-mode-btn:hover {
  border-color: #0369a1;
  background: #f0f9ff;
}

.auth-mode-label {
  font-family: sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
}

.auth-mode-desc {
  font-family: sans-serif;
  font-size: 0.82rem;
  color: #64748b;
}

/* ── Form Elements ───────────────────────────────────────── */
.form-field {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  margin-bottom: 10px;
}

.text-input {
  width: 100%;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #1e293b;
  font-family: Georgia, serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

.text-input:focus {
  border-color: #0369a1;
}

.role-picker {
  margin-top: 28px;
}

.role-options {
  display: flex;
  gap: 12px;
}

.role-option {
  flex: 1;
  padding: 14px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #64748b;
  font-family: sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  user-select: none;
}

.role-option:hover {
  border-color: #cbd5e1;
  color: #334155;
}

.role-option.selected {
  border-color: #0369a1;
  color: #0369a1;
  background: rgba(3, 105, 161, 0.07);
}

.btn-submit {
  width: 100%;
  margin-top: 32px;
  padding: 14px;
  background: #0369a1;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}

.btn-submit:hover:not(:disabled) {
  background: #0284c7;
}

.btn-submit:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ── OTP ─────────────────────────────────────────────────── */
.otp-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}

.otp-digit {
  width: 52px;
  height: 64px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #1e293b;
  font-family: sans-serif;
  font-size: 1.6rem;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
  caret-color: transparent;
}

.otp-digit:focus {
  border-color: #0369a1;
}

.form-error {
  color: #dc2626;
  font-family: sans-serif;
  font-size: 0.85rem;
  margin-top: 16px;
  min-height: 20px;
  line-height: 1.4;
}

.auth-back-btn {
  display: block;
  margin-top: 24px;
  color: #64748b;
  font-family: sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s;
  background: none;
  border: none;
  width: 100%;
}

.auth-back-btn:hover {
  color: #0369a1;
}

.otp-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-family: sans-serif;
  font-size: 0.85rem;
  color: #64748b;
}

.otp-resend-btn {
  background: none;
  border: none;
  color: #0369a1;
  font-family: sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.otp-resend-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.auth-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(3, 105, 161, 0.08);
  border: 1px solid rgba(3, 105, 161, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.4rem;
  color: #0369a1;
}

/* ── Account Page ────────────────────────────────────────── */
.account-main {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 32px 80px;
  width: 100%;
}

.account-heading {
  font-size: 1.6rem;
  font-weight: normal;
  color: #1e293b;
  margin-bottom: 40px;
}

.profile-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(3, 105, 161, 0.06);
  border: 1px solid rgba(3, 105, 161, 0.18);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-family: sans-serif;
  font-size: 0.88rem;
  color: #0369a1;
  line-height: 1.5;
}

.profile-notice-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Info Cards ──────────────────────────────────────────── */
.info-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.info-card-header {
  font-family: sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-card-edit {
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 0.95rem;
  padding: 2px 4px;
  border-radius: 3px;
  transition:
    color 0.15s,
    background 0.15s;
}

.info-card-edit:hover {
  color: #0369a1;
  background: rgba(3, 105, 161, 0.08);
}

/* ── Data Rows ───────────────────────────────────────────── */
.data-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.data-row:last-child {
  border-bottom: none;
}

.data-row-label {
  font-family: sans-serif;
  font-size: 0.8rem;
  color: #94a3b8;
  min-width: 110px;
  flex-shrink: 0;
}

.data-row-value {
  font-size: 0.95rem;
  color: #334155;
  flex: 1;
}

.role-badge {
  display: inline-block;
  font-family: sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(3, 105, 161, 0.08);
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.2);
}

.clinic-code {
  font-family: monospace;
  font-size: 1.4rem;
  letter-spacing: 6px;
  color: #0369a1;
}

/* ── Edit Form ───────────────────────────────────────────── */
.edit-form {
  padding: 18px 20px 20px;
}

.edit-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.edit-field {
  flex: 1;
}

.edit-field-label {
  display: block;
  font-family: sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  margin-bottom: 8px;
}

.edit-field-input {
  width: 100%;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #1e293b;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.edit-field-input:focus {
  border-color: #0369a1;
}

.edit-field-input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
}

.edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.btn-save {
  padding: 9px 22px;
  background: #0369a1;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover:not(:disabled) {
  background: #0284c7;
}

.btn-save:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.btn-cancel {
  padding: 9px 16px;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 0.85rem;
  color: #64748b;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.btn-cancel:hover {
  border-color: #cbd5e1;
  color: #334155;
}

.form-status {
  font-family: sans-serif;
  font-size: 0.82rem;
  color: #166534;
}

.form-status.is-error {
  color: #dc2626;
}

/* ── Email Verification ──────────────────────────────────── */
.email-verify {
  padding: 20px 20px 22px;
}

.email-verify-note {
  font-family: sans-serif;
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 20px;
  line-height: 1.5;
}

.email-verify-note strong {
  color: #1e293b;
}

.account-main .otp-group {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.account-main .otp-digit {
  width: 48px;
  height: 58px;
  font-size: 1.5rem;
}

/* ── Loading / Error States ──────────────────────────────── */
.page-state {
  font-family: sans-serif;
  font-size: 0.9rem;
  color: #64748b;
  padding: 40px 0;
}

/* ── Calibration Sign-In Form ────────────────────────────── */
.cal-auth {
  width: 100%;
  max-width: 360px;
}

.cal-auth-step {
  display: none;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.cal-auth-step.active {
  display: flex;
}

.cal-form-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  font-family: sans-serif;
}

.cal-text-input {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #1e293b;
  font-family: sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.cal-text-input:focus {
  border-color: #0369a1;
}

.cal-btn-submit {
  width: 100%;
  padding: 12px;
  background: #0369a1;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.cal-btn-submit:hover:not(:disabled) {
  background: #0284c7;
}

.cal-btn-submit:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.cal-form-error {
  font-size: 0.85rem;
  color: #dc2626;
  min-height: 1.2em;
  text-align: center;
  font-family: sans-serif;
}

.cal-otp-group {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cal-otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.4rem;
  font-family: sans-serif;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
}

.cal-otp-digit:focus {
  border-color: #0369a1;
}

.cal-back-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  font-family: sans-serif;
  text-decoration: underline;
}

.cal-back-btn:hover {
  color: #0369a1;
}

.cal-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.cal-save-btn {
  width: auto;
  padding: 10px 24px;
}

.cal-save-status {
  font-size: 0.85rem;
  font-family: sans-serif;
  color: transparent;
}

.cal-save-status.success {
  color: #166534;
}
.cal-save-status.error {
  color: #dc2626;
}

/* ── Calibration Page Layout ─────────────────────────────── */
.calibration-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  font-family: sans-serif;
}

.calibration-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px;
}

.calibration-title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #1e293b;
}

.calibration-desc {
  font-size: 0.9rem;
  color: #a9b4c3;
  text-align: center;
  max-width: 420px;
  line-height: 1.6;
}

.color-swatches {
  display: flex;
  width: 60%;
  justify-content: space-between;
  margin: 64px auto;
}

.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.swatch-box {
  width: 80px;
  height: 80px;
  border-radius: 4px;
}

.swatch-label {
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.back-nav {
  font-size: 0.9rem;
}

.back-nav-link {
  color: #0369a1;
  text-decoration: none;
}

.back-nav-link:hover {
  text-decoration: underline;
}
