/* ============================================================
   consumer/css/main.css — SORECO II PMES Consumer Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Barlow:wght@400;500;600;700&display=swap');

:root {
  --primary:       #0d6efd;
  --primary-dark:  #0950c5;
  --secondary:     #0a9396;
  --accent:        #94d2bd;
  --success:       #198754;
  --danger:        #dc3545;
  --warning:       #ffc107;
  --bg:            #ffffff;
  --surface:       #ffffff;
  --border:        #dee2e6;
  --text-main:     #1a2332;
  --text-muted:    #6c757d;
  --font-main:     'Plus Jakarta Sans', sans-serif;
  --font-display:  'Barlow', sans-serif;
  --shadow-sm:     0 2px 8px rgba(13,110,253,.08);
  --shadow-md:     0 4px 24px rgba(13,110,253,.12);
  --shadow-lg:     0 8px 40px rgba(13,110,253,.16);
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: #ffffff;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
.pmes-topbar {
  background: linear-gradient(135deg, #0d6efd 0%, #0a9396 100%);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(13,110,253,.25);
}
.pmes-topbar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.pmes-topbar .brand img { height: 36px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions .btn-logout {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.topbar-actions .btn-logout:hover { background: rgba(255,255,255,.3); }
.topbar-user {
  color: rgba(255,255,255,.9);
  font-size: .85rem;
  font-weight: 500;
}

/* ── AUTH PAGES (login / register / verify) ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(13,110,253,.04);
  top: -180px; right: -180px;
}
.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(10,147,150,.04);
  bottom: -120px; left: -120px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 4px 40px rgba(13,110,253,.10);
  border: 1px solid rgba(13,110,253,.08);
  position: relative;
  z-index: 1;
  animation: slideUp .5s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
/* When logo-icon wraps an <img> (logo.png), show it cleanly with no background */
.auth-logo .logo-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  
  box-shadow: 0 4px 16px rgba(13,110,253,.15);
}
/* When logo-icon wraps an <i> (icon fallback), keep the blue gradient box */
.auth-logo .logo-icon:has(i) {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #0d6efd, #0a9396);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(13,110,253,.3);
}
.auth-logo .logo-icon i { color: #fff; font-size: 2rem; }
.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}
.auth-logo p { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

.form-floating-custom { position: relative; margin-bottom: 16px; }
.form-floating-custom label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
  transition: all .2s;
  background: transparent;
  padding: 0 4px;
}
.form-floating-custom input:focus ~ label,
.form-floating-custom input:not(:placeholder-shown) ~ label {
  top: 0; font-size: .75rem; color: var(--primary);
  background: #fff;
}
.form-floating-custom input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .95rem;
  font-family: var(--font-main);
  color: var(--text-main);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
.form-floating-custom input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.form-floating-custom .toggle-pw {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  background: none; border: none;
  font-size: 1rem;
}

.btn-primary-full {
  width: 100%;
  background: linear-gradient(135deg, #0d6efd, #0a9396);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  margin-top: 8px;
  letter-spacing: .3px;
}
.btn-primary-full:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary-full:active { transform: translateY(0); }
.btn-primary-full:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.auth-footer { text-align: center; margin-top: 24px; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }

.alert-custom {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-danger  { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #f0fff4; color: #155724; border: 1px solid #c3e6cb; }
.alert-info    { background: #e8f4ff; color: #0c5460; border: 1px solid #bee5eb; }

/* ── SERVICE CARDS (Portal home) ── */
.portal-hero {
  text-align: center;
  padding: 56px 24px 32px;
  background: #fff;
}
.portal-hero h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}
.portal-hero p { color: var(--secondary); font-size: 1.05rem; font-weight: 500; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 56px;
  background: #ffffff;
}
.service-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: block;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: inherit;
}
.service-card .icon-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 2rem;
}
.service-card.blue .icon-wrap  { background: #e8f0ff; color: var(--primary); }
.service-card.green .icon-wrap { background: #e6f7f5; color: var(--secondary); }
.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}
.service-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 24px; }
.service-card .apply-link {
  font-size: .85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* ── STEP WIZARD ── */
.wizard-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  background: #ffffff;
}
.wizard-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  color: var(--text-main);
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
}
.stepper-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  position: relative;
}
.stepper-line.active { background: var(--primary); }
.step-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .3s;
  z-index: 1;
}
.step-dot.done    { background: var(--primary); color: #fff; }
.step-dot.active  { background: var(--primary); color: #fff; box-shadow: 0 0 0 5px rgba(13,110,253,.2); }
.step-dot.pending { background: #e9ecef; color: var(--text-muted); }

.step-panel { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.card-white {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  border: 1px solid rgba(0,0,0,.05);
}

/* Requirements list */
.req-tabs .nav-tabs { border-bottom: 2px solid var(--border); }
.req-tabs .nav-link { color: var(--text-muted); font-weight: 600; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.req-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.req-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: .93rem;
  color: var(--text-main);
}
.req-list li:last-child { border-bottom: none; }
.req-list li .req-icon { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.req-list li.sub-item { padding-left: 28px; color: var(--text-muted); font-size: .88rem; }
.req-list li.sub-item .req-icon { color: var(--text-muted); }
.req-list li strong { font-weight: 600; color: var(--text-main); }

/* Video */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  border-radius: var(--radius-md);
}
.video-overlay .overlay-msg {
  background: rgba(0,0,0,.7);
  color: #fff; border-radius: 8px;
  padding: 12px 24px; font-size: .9rem;
}
.video-progress-bar {
  background: var(--border);
  border-radius: 50px;
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
}
.video-progress-fill {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  height: 100%;
  border-radius: 50px;
  transition: width .5s ease;
}
.video-timer { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 8px; }

/* Assessment */
.question-card {
  background: #f8faff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}
.question-card .q-num {
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}
.question-card .q-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
}
.choice-label {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
  font-size: .92rem;
}
.choice-label:hover { border-color: var(--primary); background: #f0f5ff; }
.choice-label input[type=radio], .choice-label input[type=checkbox] {
  accent-color: var(--primary);
  width: 18px; height: 18px; flex-shrink: 0;
}
.choice-label.selected { border-color: var(--primary); background: #e8f0ff; }
.choice-label.correct  { border-color: var(--success); background: #f0fff4; color: var(--success); }
.choice-label.wrong    { border-color: var(--danger);  background: #fff0f0; color: var(--danger); }

.identification-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.identification-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.1); }

.score-banner {
  text-align: center;
  padding: 40px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.score-banner.pass { background: linear-gradient(135deg, #e8fff2, #f0fff8); border: 2px solid var(--success); }
.score-banner.fail { background: linear-gradient(135deg, #fff0f0, #fff5f5); border: 2px solid var(--danger); }
.score-banner .score-num {
  font-size: 4rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1;
}
.score-banner.pass .score-num { color: var(--success); }
.score-banner.fail .score-num { color: var(--danger); }

/* Details form */
.details-form .form-group { margin-bottom: 20px; }
.details-form label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 6px; color: var(--text-main); }
.details-form input, .details-form textarea, .details-form select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: .95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.details-form input:focus, .details-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,.1); }
.details-form .optional-tag { font-size: .75rem; color: var(--text-muted); font-weight: 400; }

/* Wizard nav buttons */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
}
.btn-wizard {
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-main);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-wizard-primary { background: linear-gradient(135deg, #0d6efd, #0a9396); color: #fff; }
.btn-wizard-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-wizard-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-wizard-outline { background: transparent; border: 2px solid var(--border); color: var(--text-muted); }
.btn-wizard-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Success completion */
.completion-screen {
  text-align: center;
  padding: 60px 32px;
}
.completion-screen .check-circle {
  width: 96px; height: 96px;
  background: linear-gradient(135deg, #198754, #0a9396);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  animation: popIn .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.completion-screen .check-circle i { color: #fff; font-size: 2.5rem; }
.completion-screen h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; margin-bottom: 12px; }
.completion-screen p  { color: var(--text-muted); font-size: 1rem; max-width: 420px; margin: 0 auto 24px; }

/* ── REGISTER PAGE – divider ── */
.register-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 20px 0 16px;
}

/* ── MOBILE APP INTERFACE ── */
@media (max-width: 768px) {
  body { background: #fff; }

  /* Auth on mobile - full gradient background with centered card */
  .auth-wrapper {
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: linear-gradient(160deg, #0d6efd 0%, #0a9396 100%);
    min-height: 100vh;
  }
  .auth-card {
    border-radius: 24px;
    padding: 36px 24px 40px;
    max-width: 100%;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow-y: auto;
    max-height: 90vh;
  }
  .auth-logo { margin-bottom: 24px; }
  .auth-logo .logo-icon img { width: 72px; height: 72px; }
  .auth-logo .logo-icon:has(i) { width: 56px; height: 56px; }
  .auth-logo .logo-icon i { font-size: 1.5rem; }
  .auth-logo h1 { font-size: 1.4rem; }
  .auth-logo p { font-size: .85rem; }

  /* Topbar */
  .pmes-topbar {
    padding: 0 16px;
    height: 56px;
  }
  .pmes-topbar .brand { font-size: 1rem; gap: 8px; }
  .topbar-actions .btn-logout {
    padding: 6px 14px;
    font-size: .8rem;
  }

  /* Portal hero */
  .portal-hero { padding: 28px 16px 16px; }
  .portal-hero h1 { font-size: 1.5rem; }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 16px 80px;
  }
  .service-card {
    padding: 20px 18px;
    text-align: left;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border-radius: var(--radius-md);
  }
  .service-card .icon-wrap {
    flex-shrink: 0;
    width: 52px; height: 52px;
    font-size: 1.25rem;
    margin-bottom: 0;
  }
  .service-card .card-body-text { flex: 1; }
  .service-card .apply-link { display: block; margin-top: 10px; }
  .service-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
  .service-card p { font-size: .85rem; margin-bottom: 0; }

  /* Wizard container */
  .wizard-container { padding: 16px 14px 100px; }
  .wizard-title { font-size: 1.2rem; margin-bottom: 16px; }

  /* Stepper – smaller dots on mobile */
  .stepper { margin-bottom: 24px; }
  .step-dot { width: 30px; height: 30px; font-size: .78rem; }
  .step-label { display: none; }

  /* Cards */
  .card-white {
    padding: 18px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
  }

  /* Mobile fixed bottom nav bar for wizard */
  .wizard-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
    z-index: 999;
    gap: 10px;
  }
  .btn-wizard {
    padding: 13px 20px;
    font-size: .88rem;
    border-radius: 50px;
    min-width: 0;
  }
  .btn-wizard-outline {
    flex-shrink: 0;
    padding: 13px 18px;
  }
  .btn-wizard-primary {
    flex: 1;
    justify-content: center;
  }

  /* Make submit button in assessment form also full-width on mobile */
  #assessmentForm .wizard-nav .btn-wizard-primary {
    flex: 1;
    justify-content: center;
  }

  /* Video mobile */
  .video-wrapper { border-radius: var(--radius-sm); }
  .video-progress-bar { margin-top: 12px; }

  /* Score banner */
  .score-banner .score-num { font-size: 3rem; }
  .score-banner { padding: 28px 20px; }

  /* Question cards */
  .question-card { padding: 18px 14px; }

  /* Details form grid – single column */
  .details-grid { grid-template-columns: 1fr !important; }
  .details-grid [style*="grid-column"] { grid-column: 1 !important; }

  /* Completion screen */
  .completion-screen { padding: 40px 20px; }
  .completion-screen h2 { font-size: 1.4rem; }
  .completion-screen .check-circle { width: 80px; height: 80px; }
  .completion-screen .check-circle i { font-size: 2rem; }
}

@media (max-width: 380px) {
  .auth-card { padding: 24px 14px 36px; }
  .auth-logo .logo-icon { width: 52px; height: 52px; }
  .auth-logo h1 { font-size: 1.2rem; }
  .wizard-container { padding: 12px 10px 100px; }
  .card-white { padding: 14px 12px; }
  .btn-wizard { padding: 12px 14px; font-size: .84rem; }
}