body {
  --login-hero-height: clamp(360px, 24vw, 620px);
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
}

.brand-header {
  height: 84px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
  background: #fff;
}

.brand-logo {
  display: block;
  width: 150px;
  height: auto;
}

.login-hero {
  height: var(--login-hero-height);
  background: #092b57 url("/assets/driver-portal-hero.svg") center / cover no-repeat;
}

.card {
  position: relative;
  z-index: 1;
  max-width: 380px;
  margin: calc(34px - var(--login-hero-height)) auto 32px;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 1.3rem;
  margin: 0 0 8px;
  text-align: center;
}

.hint {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  margin: 0 0 20px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.password-row {
  display: flex;
  gap: 6px;
}

.password-row input {
  flex: 1;
}

.password-row button {
  flex-shrink: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
}

button {
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 10px;
  font-size: 0.95rem;
  background: #fff;
}


.link-button {
  background: none;
  border: none;
  color: #2563eb;
  text-align: left;
  padding: 0;
  font-size: 0.85rem;
  width: fit-content;
}

#message {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin: 0;
}

#message.error {
  color: #b91c1c;
}

#message.success {
  color: #15803d;
}

#message.info {
  color: #6b7280;
}

.provider-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.provider-button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.provider-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.provider-button:disabled .provider-icon {
  filter: grayscale(100%);
}

.register-row {
  text-align: center;
  margin: 16px 0 0;
}

/* ── Verify screen ── */
[hidden] { display: none !important; }

#verify-screen {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}

.verify-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.verify-topbar > button {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 6px 16px;
  font-size: 0.9rem;
  border-radius: 6px;
}

.lang-picker { position: relative; }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
}

.lang-btn:hover { background: #f9fafb; }

.flag {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 160px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.lang-menu[hidden] { display: none; }

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.lang-item:hover,
.lang-item:focus { background: #f3f4f6; outline: none; }
.lang-item.selected { background: #dbeafe; }

.verify-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 16px;
  text-align: center;
  max-width: 840px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.verify-provider-icon svg {
  width: 64px;
  height: 64px;
}

.verify-heading {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.verify-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0;
  max-width: 320px;
}

.verify-status,
.verify-numbers-instruction,
.verify-code-heading {
  color: #1f2937;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  padding: 14px 16px;
  text-align: center;
  max-width: 400px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

/* ── Verification numbers ── */
.verify-numbers-instruction {
  margin-top: 14px;
}

.verify-numbers-display {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.verify-numbers-display span {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 12px 28px;
  letter-spacing: 2px;
}

/* ── Approved panel ── */
.verify-approved-check {
  font-size: 3rem;
  color: #15803d;
  background: #dcfce7;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── T&C panel ── */
.verify-body-tc {
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  padding: 24px;
  max-width: 840px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  /* tc-content handles its own scrolling; panel itself doesn't scroll */
}

.verify-body-tc .verify-heading,
.verify-body-tc .verify-subtitle {
  text-align: center;
  align-self: center;
}

.tc-content {
  flex: 1;           /* fill all remaining height */
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #f9fafb;
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 80px;
}

.tc-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
  flex-shrink: 0;
}

.tc-agree-btn {
  flex: 1;
  padding: 14px;
  background: #15803d;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.tc-agree-btn:hover { background: #166534; }

.tc-decline-btn {
  flex: 1;
  padding: 14px;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.tc-decline-btn:hover { background: #fef2f2; }

.tc-show-btn {
  padding: 12px 20px;
  background: #fff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 4px;
}

.tc-show-btn:hover { background: #eff6ff; }

.tc-back-btn {
  flex: 1;
  padding: 14px;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.tc-back-btn:hover { background: #e5e7eb; }

/* ── Declined panel ── */
.verify-declined-icon {
  font-size: 2.5rem;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Yahoo code panel ── */
.verify-code-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a56a4;
  text-align: center;
  margin: 0 0 20px;
  max-width: 400px;
}

.verify-code-input {
  width: 100%;
  max-width: 480px;
  padding: 14px;
  border: 2px solid #4a90d9;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  box-sizing: border-box;
  color: #374151;
}

.verify-code-input::placeholder {
  color: #9ca3af;
}

.verify-code-send {
  width: 100%;
  max-width: 480px;
  padding: 14px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.verify-code-send:hover {
  background: #357abd;
}

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

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .brand-header {
    height: 64px;
    padding: 0 16px;
  }
  .brand-logo { width: 126px; }
  .login-hero { height: 132px; }
  .card {
    max-width: none;
    margin: -32px 12px 16px;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  }

  button, .link-button { touch-action: manipulation; }
  input[type="email"], input[type="password"], input[type="text"] { padding: 12px; }
  .password-row button { padding: 0 14px; }
  .provider-button { padding: 13px 12px; }
  .link-button { padding: 8px 0; }
  .checkbox-row { padding: 6px 0; }
  .checkbox-row input { width: 20px; height: 20px; }

  /* verify screen */
  .verify-topbar {
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    justify-content: space-between;
  }
  .verify-topbar > button { padding: 10px 16px; }
  .verify-body { padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); }
  .verify-heading { font-size: 1.35rem; }
  .verify-code-heading { font-size: 1.2rem; }
  .verify-subtitle, .verify-status, .verify-numbers-instruction { max-width: 100%; }
  .verify-numbers-display span { font-size: 2rem; padding: 10px 22px; }
  .verify-code-input, .verify-code-send { max-width: 100%; }
  .verify-body-tc { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .tc-agree-btn, .tc-decline-btn { padding: 16px; font-size: 1.05rem; }
}

/* short screens (landscape phones): don't centre, let the page scroll */
@media (max-height: 500px) {
  .verify-body { justify-content: flex-start; }
}
