/* ==========================================================================
   1. BASE RESETS & LAYOUT
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f0f2f5;
  color: #1c1e21;
  padding: 15px;
  line-height: 1.5;
}

#quiz-container {
  max-width: 650px;
  margin: 10px auto;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  position: relative;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   2. HEADER & CANDIDATE BADGE
   ========================================================================== */
header {
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

header h2 {
  font-size: 20px;
  color: #0056b3;
  margin-bottom: 6px;
}

#user-badge {
  font-size: 13px;
  color: #495057;
  font-weight: 600;
  background-color: #e7f1ff;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

#candidate-name {
  color: #0d6efd;
}

#timer {
  font-size: 15px;
  font-weight: bold;
  color: #dc3545;
  margin-top: 8px;
}

/* ==========================================================================
   3. AUTHENTICATION TABS & FORM INPUTS
   ========================================================================== */
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 8px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  margin-top: 0;
  background-color: #e9ecef;
  color: #495057;
  font-size: 13px;
  border-radius: 4px;
}

.tab-btn.active {
  background-color: #0d6efd;
  color: #ffffff;
}

h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #212529;
}

.subtitle {
  color: #6c757d;
  font-size: 13px;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
  color: #343a40;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ced4da;
  font-size: 15px;
  background-color: #fff;
  box-sizing: border-box;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

button {
  width: 100%;
  padding: 12px 16px;
  margin-top: 16px;
  background-color: #0d6efd;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:disabled {
  background-color: #a5c7fe;
  cursor: not-allowed;
}

.secondary-btn {
  background-color: #6c757d;
}

/* ==========================================================================
   4. ACTIVE EXAM & PASSAGE DISPLAY
   ========================================================================== */
.passage-box {
  background-color: #eef2f7;
  border-left: 4px solid #0d6efd;
  padding: 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  max-height: 200px;
  overflow-y: auto;
  color: #2b3035;
}

#question-box {
  background-color: #f8f9fa;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 20px;
}

#question-text {
  font-size: 16px;
  font-weight: 500;
  color: #212529;
  margin-bottom: 16px;
}

.option-btn {
  background-color: #ffffff;
  color: #212529;
  text-align: left;
  border: 1px solid #dee2e6;
  margin-top: 8px;
  font-weight: 400;
  padding: 12px;
}

.option-btn.selected {
  background-color: #198754;
  color: #ffffff;
  border-color: #198754;
}

.navigation-btns {
  display: flex;
  gap: 10px;
}

.navigation-btns button {
  flex: 1;
  margin-top: 0;
}

#prev-btn {
  background-color: #6c757d;
}

#submit-btn {
  background-color: #dc3545;
}

/* ==========================================================================
   5. REVIEW & EXPLANATIONS SECTION
   ========================================================================== */
#score-screen {
  text-align: center;
}

#final-score {
  font-size: 18px;
  background-color: #e7f1ff;
  padding: 14px;
  border-radius: 8px;
  color: #084298;
  margin-bottom: 20px;
}

#review-container {
  text-align: left;
  margin-top: 24px;
}

.review-item {
  background: #ffffff;
  border-left: 5px solid #adb5bd;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.review-item.correct {
  border-left-color: #198754;
  background-color: #f6fff8;
}

.review-item.incorrect {
  border-left-color: #dc3545;
  background-color: #fff8f8;
}

.review-status {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.review-item.correct .review-status {
  color: #198754;
}

.review-item.incorrect .review-status {
  color: #dc3545;
}

/* ==========================================================================
   6. WHATSAPP CHANNEL PROMOTIONS & NOTIFICATIONS
   ========================================================================== */
.cbt-channel-box {
  background: #f0fdf4;
  border: 1.5px solid #25D366;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.channel-content h3 {
  color: #166534;
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
}

.channel-content p {
  color: #4b5563;
  margin: 0;
  font-size: 13.5px;
}

.channel-btn {
  background-color: #25D366;
  color: #ffffff;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.channel-btn:hover {
  background-color: #128C7E;
}

@media (max-width: 600px) {
  .cbt-channel-box {
    flex-direction: column;
    text-align: center;
  }
  .channel-btn {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   7. PROFESSIONAL FOOTER & COPYRIGHT
   ========================================================================== */
.app-footer {
  margin-top: 30px;
  padding-top: 15px;
  text-align: center;
}

.footer-channel-link {
  margin-bottom: 12px;
  font-size: 14px;
  color: #343a40;
}

.footer-channel-link a {
  color: #25D366;
  font-weight: 700;
  text-decoration: none;
}

.footer-channel-link a:hover {
  text-decoration: underline;
}

.footer-divider {
  height: 1px;
  background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.1), rgba(0,0,0,0));
  margin-bottom: 15px;
}

.copyright-text {
  font-size: 12px;
  letter-spacing: 0.3px;
  color: #6c757d;
}

.copyright-text strong {
  color: #0d6efd;
  font-weight: 600;
}

/* ==========================================================================
   PRODUCTION POLISH + PRACTICE GUIDE
   ========================================================================== */
body { background: linear-gradient(135deg, #eef4ff 0%, #f7f9fc 50%, #eef8f3 100%); }
#quiz-container { max-width: 760px; border: 1px solid #e6ebf2; }
header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; }
header h2 { font-size: 21px; letter-spacing: -0.3px; }
button { box-shadow: 0 3px 10px rgba(13,110,253,.10); }
button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(.98); }
#setup-screen > select { margin-bottom: 4px; }
.guide-btn { background: #173b72; }
.guide-panel { margin-top: 18px; padding: 20px; border:1px solid #dbe5f4; border-radius:14px; background:#f8fbff; text-align:left; }
.guide-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.eyebrow { font-size:11px; font-weight:800; letter-spacing:1.2px; color:#0d6efd; }
.guide-header h3 { margin-top:3px; }
.guide-close { width:36px; height:36px; padding:0; margin:0; border-radius:50%; background:#e9eef6; color:#334155; font-size:24px; box-shadow:none; }
.guide-intro { color:#526173; font-size:14px; margin:10px 0 15px; }
.guide-topics { display:grid; gap:10px; }
.guide-topic { display:flex; gap:12px; padding:13px; border:1px solid #e3e9f2; border-radius:11px; background:white; }
.guide-topic-number { flex:0 0 30px; width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#e8f1ff; color:#0d6efd; font-weight:800; }
.guide-topic h4 { margin-bottom:4px; color:#24364b; }
.guide-topic p { color:#65758b; font-size:13px; }
#question-number { color:#0d6efd; margin-bottom:10px; }
.option-btn { transition: all .18s ease; }
.option-btn:hover { border-color:#0d6efd; background:#f5f9ff; }
@media (max-width: 600px) { body { padding:8px; } #quiz-container { padding:16px; margin:4px auto; border-radius:10px; } header { display:block; } #timer { margin-top:10px; } .navigation-btns { flex-wrap:wrap; } .navigation-btns button { min-width:calc(50% - 5px); } }


/* Professional payment notices */
#payment-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 18px);
  width: min(92vw, 520px);
  padding: 14px 18px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #1f2937;
  box-shadow: 0 12px 35px rgba(0,0,0,.18);
  border-left: 5px solid #64748b;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity .2s ease, transform .2s ease;
  font-weight: 600;
  line-height: 1.45;
}
#payment-notice.show { opacity: 1; transform: translate(-50%, 0); }
#payment-notice.success { background: #ecfdf3; color: #166534; border-left-color: #16a34a; }
#payment-notice.error { background: #fef2f2; color: #b91c1c; border-left-color: #dc2626; }
#payment-notice.info { background: #eff6ff; color: #1d4ed8; border-left-color: #2563eb; }


/* Professional unlock dialog */
body.modal-open { overflow: hidden; }
.unlock-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(5px);
}
.unlock-card {
  width: min(100%, 460px); background: #fff; border-radius: 22px;
  padding: 28px 22px 22px; position: relative;
  box-shadow: 0 25px 70px rgba(0,0,0,.28); text-align: center;
}
.unlock-close {
  position: absolute; top: 12px; right: 14px; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: #f1f5f9; color: #475569;
  font-size: 26px; cursor: pointer;
}
.unlock-icon { font-size: 36px; margin-bottom: 8px; }
.unlock-eyebrow { font-size: 11px; letter-spacing: 1.2px; font-weight: 800; color: #2563eb; }
.unlock-card h3 { margin: 7px 0 8px; font-size: 24px; color: #0f172a; }
.unlock-card p { color: #64748b; line-height: 1.55; }
.unlock-options { display: grid; gap: 11px; margin: 20px 0 14px; }
.unlock-option { width: 100%; border: 0; border-radius: 13px; padding: 15px 16px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.unlock-option strong { font-size: 16px; }
.unlock-option span { font-size: 13px; opacity: .9; }
.unlock-option.primary { background: #0d6efd; color: #fff; }
.unlock-option.secondary { background: #e8f5ee; color: #166534; border: 1px solid #bbf7d0; }
.unlock-footnote { font-size: 11px !important; margin-top: 8px; }

/* ========================================================================
   FINAL PROFESSIONAL AUTH + STUDENT DASHBOARD
   ======================================================================== */
body {
  min-height: 100vh;
  padding: 24px 14px;
  background: radial-gradient(circle at top left, #e8f0ff 0, transparent 35%),
              radial-gradient(circle at bottom right, #e8f8f0 0, transparent 35%), #f5f7fb;
}

#quiz-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 70px rgba(15,23,42,.12);
}

header {
  margin: 0;
  padding: 18px 28px;
  background: #0f2f5f;
  color: #fff;
  border: 0;
}
header h2 { color: #fff; margin: 0; font-size: 16px; }
#user-badge { background: rgba(255,255,255,.12); color: #e8f1ff; margin: 0; }
#candidate-name { color: #fff; }
#timer { color: #ffd7d7; margin: 0; }

#auth-screen, #setup-screen, #exam-area, #score-screen { padding: 30px; }

.auth-brand {
  display: flex; align-items: center; gap: 16px; margin: 2px auto 28px;
  max-width: 560px;
}
.auth-brand-mark {
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center;
  background: #0d6efd; color: #fff; font-weight: 900; font-size: 18px;
  box-shadow: 0 10px 25px rgba(13,110,253,.22);
}
.auth-brand-kicker, .dashboard-kicker {
  display: block; font-size: 10px; font-weight: 900; letter-spacing: 1.6px; color: #0d6efd;
}
.auth-brand h1 { margin: 2px 0 1px; color: #10233f; font-size: 27px; letter-spacing: -.6px; }
.auth-brand p { color: #6b7789; font-size: 13px; }

.auth-tabs {
  max-width: 560px; margin: 0 auto 22px; padding: 5px; border: 1px solid #e4e9f1;
  border-radius: 13px; background: #f4f7fb; gap: 4px;
}
.tab-btn { margin: 0; border-radius: 9px; background: transparent; color: #637087; box-shadow: none; }
.tab-btn.active { background: #fff; color: #0d6efd; box-shadow: 0 3px 12px rgba(15,23,42,.08); }
.auth-form, #verify-box, #reset-verify-box, #new-password-box { max-width: 560px; margin: 0 auto; }
.auth-form h3 { font-size: 22px; color: #142945; margin-bottom: 6px; }
.auth-form .subtitle { color: #718096; }
.auth-form label { color: #34445c; margin-top: 16px; }
.auth-form input { border-color: #dbe2ec; border-radius: 11px; padding: 13px 14px; }
.auth-form button { border-radius: 11px; margin-top: 20px; padding: 13px 16px; }

.dashboard-hero {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  padding: 25px; border-radius: 19px; background: linear-gradient(135deg,#0f2f5f,#174a87);
  color: #fff; box-shadow: 0 14px 35px rgba(15,47,95,.16); margin-bottom: 16px;
}
.dashboard-hero h1 { margin: 5px 0 5px; font-size: 25px; letter-spacing: -.5px; }
.dashboard-hero p { color: #d7e5f7; font-size: 13px; }
.dashboard-kicker { color: #a9c9f5; }
.dashboard-status { white-space: nowrap; padding: 8px 11px; border-radius: 99px; background: rgba(255,255,255,.11); font-size: 11px; font-weight: 700; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #65d48b; }
.dashboard-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; margin-bottom: 17px; }
.dashboard-stats div { padding: 15px; border: 1px solid #e6ebf2; border-radius: 14px; background: #fff; }
.dashboard-stats span { display: block; font-size: 18px; margin-bottom: 5px; }
.dashboard-stats strong { display: block; color: #172b47; font-size: 17px; }
.dashboard-stats small { color: #7a8799; font-size: 11px; }
.setup-card { padding: 22px; border: 1px solid #e4eaf2; border-radius: 18px; background: #fbfcfe; }
.section-heading { display: flex; gap: 11px; align-items: center; margin-bottom: 8px; }
.section-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #e8f1ff; color: #0d6efd; }
.section-heading h3 { margin: 0; font-size: 18px; }
.section-heading p { color: #718096; font-size: 12px; margin-top: 2px; }
#setup-screen > label { margin-top: 16px; }
#setup-screen > select { border-radius: 11px; border-color: #dbe2ec; background: #fff; }
#start-btn { height: 48px; border-radius: 11px; font-size: 15px; margin-top: 21px; }
#unlock-all-btn { border-radius: 11px !important; margin-top: 16px; }
#practice-guide-btn, #switch-user-btn { border-radius: 11px; }

.unlock-option:disabled { opacity: .65; cursor: wait; transform: none !important; }

@media (max-width: 600px) {
  body { padding: 8px; }
  #quiz-container { border-radius: 18px; }
  header { padding: 15px 17px; }
  #auth-screen, #setup-screen, #exam-area, #score-screen { padding: 19px 16px; }
  .auth-brand h1 { font-size: 22px; }
  .auth-brand-mark { width: 50px; height: 50px; }
  .dashboard-hero { padding: 19px; flex-direction: column; }
  .dashboard-hero h1 { font-size: 21px; }
  .dashboard-status { align-self: flex-start; }
  .dashboard-stats { gap: 7px; }
  .dashboard-stats div { padding: 11px 9px; }
  .dashboard-stats small { font-size: 9px; }
  .setup-card { padding: 16px; }
}


/* =====================================================================
   FINAL UI POLISH — CLEAN SUBJECT STATUS, BRAND LOGO & NOTIFICATIONS
   ===================================================================== */
.auth-brand-logo {
  width: 118px;
  height: 92px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 18px rgba(15, 47, 95, .12));
}
.auth-brand-copy { min-width: 0; }
.auth-brand h1 { font-weight: 800; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.tab-btn { min-height: 48px; font-size: 13px; font-weight: 700; }
.auth-form input:focus, #setup-screen > select:focus {
  outline: none;
  border-color: #2d73d5;
  box-shadow: 0 0 0 4px rgba(45, 115, 213, .10);
}
#login-btn, #reg-btn, #reset-btn, #confirm-verify-btn, #confirm-reset-verify-btn, #update-password-btn {
  width: 100%;
  background: linear-gradient(135deg, #0f3b73, #1765b4);
  color: #fff;
  font-weight: 800;
}
#login-btn:disabled, #reg-btn:disabled, #reset-btn:disabled,
#confirm-verify-btn:disabled, #confirm-reset-verify-btn:disabled, #update-password-btn:disabled {
  opacity: .65;
  cursor: wait;
}
.dashboard-stats { grid-template-columns: repeat(3, 1fr); }
.dashboard-stats div { min-height: 92px; }
#setup-screen > select { width: 100%; }

/* No access icons in the subject dropdown. */
#subject option { padding: 10px; }

.app-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200000;
  width: min(92vw, 470px);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid #dbe3ed;
  border-left: 4px solid #64748b;
  border-radius: 14px;
  background: #fff;
  color: #253247;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, 18px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.app-notice.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.app-notice.success { border-left-color: #16a34a; color: #166534; background: #f0fdf4; }
.app-notice.error { border-left-color: #dc2626; color: #b91c1c; background: #fff5f5; }
.app-notice.info { border-left-color: #2563eb; color: #1d4ed8; background: #f5f9ff; }
.notice-icon {
  width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center;
  border-radius: 50%; background: currentColor; color: #fff; font-size: 13px; font-weight: 900;
}

@media (max-width: 600px) {
  .auth-brand { align-items: center; gap: 12px; margin-bottom: 22px; }
  .auth-brand-logo { width: 88px; height: 74px; }
  .auth-brand h1 { font-size: 20px; }
  .auth-brand p { font-size: 12px; }
  .auth-tabs { grid-template-columns: 1fr; }
  .tab-btn { min-height: 43px; }
  .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
  .dashboard-stats div { min-height: 82px; }
  .app-notice { bottom: 16px; }
}


/* ===== PROFESSIONAL NOTIFICATIONS ===== */
.app-notice {
  position: fixed;
  top: 18px;
  left: 50%;
  bottom: auto;
  z-index: 300000;
  width: min(92vw, 430px);
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 42px 13px 13px;
  border: 1px solid #dbe4ef;
  border-left: 4px solid #64748b;
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  color: #20324b;
  box-shadow: 0 16px 45px rgba(15,23,42,.18);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: translate(-50%, -14px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  overflow: hidden;
}
.app-notice.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.app-notice.success { border-left-color: #16a34a; }
.app-notice.error { border-left-color: #dc2626; }
.app-notice.info { border-left-color: #2563eb; }
.notice-icon {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border-radius: 50%; background: #64748b; color: #fff; font-size: 17px; font-weight: 900;
}
.app-notice.success .notice-icon { background: #16a34a; }
.app-notice.error .notice-icon { background: #dc2626; }
.app-notice.info .notice-icon { background: #2563eb; }
.notice-content { display:flex; flex-direction:column; gap:2px; min-width:0; }
.notice-title { font-size: 13px; color:#172b47; }
.app-notice.success .notice-title { color:#166534; }
.app-notice.error .notice-title { color:#b91c1c; }
.app-notice.info .notice-title { color:#1d4ed8; }
.notice-message { font-weight: 600; color:#53647b; }
.app-notice.success .notice-message { color:#35634a; }
.app-notice.error .notice-message { color:#7f3030; }
.app-notice.info .notice-message { color:#405d83; }
.notice-close {
  position:absolute; top:8px; right:8px; width:28px; height:28px; border:0; margin:0;
  padding:0; background:transparent; color:#7a8798; box-shadow:none; font-size:20px; line-height:1;
}
.notice-close:hover { background:#f1f5f9; }
.notice-progress {
  position:absolute; left:0; bottom:0; height:3px; width:100%;
  background:currentColor; opacity:.15; transform-origin:left;
  animation: noticeProgress 5s linear forwards;
}
.app-notice.error .notice-progress { animation-duration:6.5s; }
@keyframes noticeProgress { from{transform:scaleX(1)} to{transform:scaleX(0)} }

/* ===== PWA INSTALL PROMPT ===== */
.install-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 250000;
  width: min(94vw, 520px);
  display: grid;
  grid-template-columns: 52px 1fr auto 34px;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border: 1px solid #d9e4f2;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 55px rgba(15,23,42,.20);
  transform: translate(-50%, 140%);
  transition: transform .28s ease;
}
.install-banner:not(.hidden) { transform: translate(-50%, 0); }
.install-app-icon { width:52px; height:52px; border-radius:14px; overflow:hidden; box-shadow:0 5px 16px rgba(15,47,95,.18); }
.install-app-icon img { width:100%; height:100%; display:block; }
.install-copy { display:flex; flex-direction:column; gap:3px; min-width:0; }
.install-copy strong { color:#102b4f; font-size:14px; }
.install-copy span { color:#6b7789; font-size:12px; }
.install-action {
  margin:0; padding:10px 16px; border:0; border-radius:11px; background:#0d6efd; color:#fff;
  font-weight:800; box-shadow:0 6px 16px rgba(13,110,253,.2);
}
.install-dismiss {
  width:30px; height:30px; margin:0; padding:0; border:0; background:transparent; color:#7a8798;
  box-shadow:none; font-size:21px;
}
@media (max-width: 600px) {
  .app-notice { top: 12px; width: min(94vw, 430px); }
  .install-banner { bottom: 12px; grid-template-columns:46px 1fr auto 30px; gap:9px; padding:10px; }
  .install-app-icon { width:46px; height:46px; }
  .install-copy strong { font-size:13px; }
  .install-copy span { font-size:11px; }
  .install-action { padding:9px 12px; font-size:12px; }
}


/* ===== PROFESSIONAL APP LOADER / SPLASH ===== */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(45,115,213,.12), transparent 34%),
    linear-gradient(160deg, #f8fbff 0%, #eef4fb 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity .38s ease, visibility .38s ease;
}
.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.app-loader-card {
  width: min(88vw, 360px);
  padding: 34px 28px 28px;
  text-align: center;
  border: 1px solid rgba(214,226,241,.9);
  border-radius: 26px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 70px rgba(15,47,95,.16);
  backdrop-filter: blur(12px);
}
.app-loader-icon-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
}
.app-loader-icon {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  display: block;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15,47,95,.18);
}
.app-loader-ring {
  position: absolute;
  inset: -7px;
  border: 3px solid rgba(23,101,180,.15);
  border-top-color: #1765b4;
  border-right-color: #0f3b73;
  border-radius: 50%;
  animation: appLoaderSpin 1s linear infinite;
}
.app-loader-brand {
  color: #0f2f5f;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.app-loader-subtitle {
  margin-top: 5px;
  color: #6b7789;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.app-loader-progress {
  width: 100%;
  height: 5px;
  margin: 24px 0 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef7;
}
.app-loader-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f3b73, #2d73d5);
  animation: appLoaderProgress 1.15s ease-in-out infinite;
}
.app-loader-status {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
@keyframes appLoaderSpin { to { transform: rotate(360deg); } }
@keyframes appLoaderProgress {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(125%); }
  100% { transform: translateX(280%); }
}

/* Keep the install invitation prominent and app-like. */
.install-banner {
  border-color: #cddbea;
  box-shadow: 0 20px 60px rgba(15,23,42,.22);
}
.install-action:disabled { opacity: .65; cursor: wait; }
.install-action::before { content: "↧ "; font-weight: 900; }
@media (max-width: 600px) {
  .app-loader-card { padding: 30px 22px 24px; border-radius: 22px; }
}
