/* =============================================
   Twende Driver Recruitment Portal
   ============================================= */

:root {
  --primary:       #F7A800;
  --primary-dark:  #E09500;
  --primary-light: #FFD166;
  --bg:            #F5F6FA;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --text-primary:  #1A202C;
  --text-secondary:#718096;
  --text-muted:    #A0AEC0;
  --success:       #38A169;
  --success-light: #F0FFF4;
  --danger:        #E53E3E;
  --danger-light:  #FFF5F5;
  --info:          #3182CE;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.12);
  --transition:    0.2s ease;
}

/* ── Reset ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  display: flex;
  justify-content: center;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0b1b33;  /* dark backdrop beside the phone frame on wide screens */
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Container ────────────────────────────── */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);   /* the phone-screen surface; body shows the dark backdrop */
  padding: 20px 16px 40px;
}
@media (min-width: 481px) {
  .container { box-shadow: 0 0 50px rgba(0, 0, 0, 0.35); }
}

/* ── Header (orange hero) ─────────────────── */
header {
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 18px;
  padding: 26px 20px 20px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(247, 168, 0, 0.25);
}
header .logo {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  margin: 0 auto 8px;
}
header h1 {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}
header .tagline {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  margin-top: 4px;
}
header .benefits {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
header .benefit {
  flex: 1 1 0;
  max-width: 110px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 9px 4px;
}
header .benefit span {
  font-size: 20px;
  display: block;
  line-height: 1.1;
}
header .benefit small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* ── Progress Bar ─────────────────────────── */
.progress-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 2px solid var(--border);
  transition: all var(--transition);
}
.progress-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.progress-step.active {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: #FFF9ED;
}
.progress-step.active span {
  background: var(--primary);
  color: #fff;
}
.progress-step.done {
  color: var(--success);
  border-color: var(--success);
  background: var(--success-light);
}
.progress-step.done span {
  background: var(--success);
  color: #fff;
}

/* ── Steps ────────────────────────────────── */
.step {
  display: none;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}
.step.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.step-desc {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
}

/* ── Form ─────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(247, 168, 0, 0.15);
}
.form-group input::placeholder {
  color: var(--text-muted);
}
.form-group input.error {
  border-color: var(--danger);
}
.form-group .error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Vehicle Cards ────────────────────────── */
.vehicle-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}
.vehicle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  user-select: none;
}
.vehicle-card:hover {
  border-color: var(--primary-light);
  background: #FFFBF0;
}
.vehicle-card.selected {
  border-color: var(--primary);
  background: #FFF9ED;
  box-shadow: 0 0 0 3px rgba(247, 168, 0, 0.15);
}
.vehicle-icon {
  font-size: 36px;
  margin-bottom: 6px;
}
.vehicle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  min-height: 48px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(247, 168, 0, 0.3);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}
.btn-sm {
  padding: 8px 20px;
  font-size: 14px;
  min-height: 40px;
  width: auto;
}
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.btn-row .btn-secondary {
  flex: 0 0 auto;
}
.btn-row .btn-primary {
  flex: 1;
}

/* ── Document Upload ──────────────────────── */
.doc-upload {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  transition: border-color var(--transition);
}
.doc-upload:hover {
  border-color: var(--primary-light);
}
.doc-upload label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.doc-upload input[type="file"] {
  width: 100%;
  font-size: 14px;
  color: var(--text-secondary);
}
.doc-upload input[type="file"]::file-selector-button {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-right: 10px;
  transition: all var(--transition);
}
.doc-upload input[type="file"]::file-selector-button:hover {
  background: var(--bg);
  border-color: var(--primary);
}
.upload-status {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
}
.upload-status.uploading { color: var(--info); }
.upload-status.success   { color: var(--success); }
.upload-status.error     { color: var(--danger); }
.doc-upload.uploaded {
  border-color: var(--success);
  border-style: solid;
  background: var(--success-light);
}

/* ── Success Box ──────────────────────────── */
.success-box {
  background: var(--success-light);
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--success);
  font-size: 15px;
  margin-top: 20px;
}

/* ── Error Box ────────────────────────────── */
.error-box {
  background: var(--danger-light);
  border: 2px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  color: var(--danger);
  margin-bottom: 16px;
}

/* ── Status Check ─────────────────────────── */
.status-check {
  text-align: center;
  margin-top: 12px;
  padding: 16px;
}
.status-check p {
  color: var(--text-secondary);
  font-size: 14px;
}
#status-form {
  margin-top: 12px;
}
.status-form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.status-form-row input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.status-form-row input:focus {
  outline: none;
  border-color: var(--primary);
}
#status-result {
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0;
}
#status-result.has-result {
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.status-card {
  font-size: 14px;
}
.status-card .status-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg);
}
.status-card .status-row:last-child {
  border-bottom: none;
}
.status-card .status-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.status-card .status-value {
  font-weight: 600;
}
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-badge.pending   { background: #FEFCBF; color: #975A16; }
.status-badge.submitted { background: #BEE3F8; color: #2A4365; }
.status-badge.approved  { background: #C6F6D5; color: #22543D; }
.status-badge.rejected  { background: #FED7D7; color: #9B2C2C; }

/* ── Footer ───────────────────────────────── */
footer {
  text-align: center;
  padding: 24px 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}
footer a {
  color: var(--text-muted);
}
footer a:hover {
  color: var(--primary-dark);
}

/* ── Loading spinner ──────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 480px) {
  .container {
    padding: 12px 12px 32px;
  }
  header {
    padding: 22px 16px 16px;
  }
  header h1 {
    font-size: 25px;
  }
  header .benefit small {
    font-size: 10px;
  }
  .step {
    padding: 20px 16px;
  }
  .progress-bar {
    gap: 4px;
  }
  .progress-step {
    padding: 6px 10px;
    font-size: 11px;
  }
  .vehicle-cards {
    gap: 8px;
  }
  .vehicle-card {
    padding: 14px 6px;
  }
  .vehicle-icon {
    font-size: 28px;
  }
}

/* ── Done / download step ─────────────────── */
.done-hero {
  text-align: center;
  padding: 8px 0 16px;
}
.done-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 16px;
}
@media (min-width: 480px) {
  .download-cta { flex-direction: row; }
  .download-cta .store-btn { flex: 1; }
}
.store-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #1A202C;
  color: #fff !important;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: var(--transition);
}
.store-btn:hover { background: #000; transform: translateY(-1px); }
.store-btn .store-ico { font-size: 24px; line-height: 1; }
.store-btn .store-txt {
  display: flex;
  flex-direction: column;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
}
.store-btn .store-txt small {
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.login-hint {
  background: var(--primary-light);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.docs-optional {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 14px;
}
.docs-optional > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
  list-style: revert;
}
.docs-optional .muted { color: var(--text-muted); font-weight: 400; font-size: 13px; }

.docs-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 16px;
}
