/* =========================================================
   TEAM BOSS FITNESS ACADEMY — EXAM PORTAL
   Fresh Premium Stylesheet v2
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --primary:        #0f3d91;
  --primary-dark:   #09275e;
  --accent:         #1e63e9;
  --accent-light:   #4d8af0;
  --gold:           #d4af37;
  --bg:             #eef4ff;
  --text:           #0f1c2e;
  --muted:          #6b7c99;
  --border:         #dce7f7;
  --success:        #0f9d58;
  --error:          #e53935;
  --radius-sm:      12px;
  --radius-md:      18px;
  --radius-lg:      26px;
  --radius-xl:      34px;
  --ease:           cubic-bezier(.4,0,.2,1);
  --spring:         cubic-bezier(.34,1.56,.64,1);
}

/* ── Base Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Mesh Background ──────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 70% at 15% -5%,  rgba(30,99,233,.20) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 92%  8%,  rgba(15,61,145,.15) 0%, transparent 50%),
    radial-gradient(ellipse 50% 45% at 50% 105%, rgba(212,175,55,.10) 0%, transparent 55%),
    linear-gradient(168deg, #e4effe 0%, #f2f7ff 40%, #ebf2fc 100%);
}

/* ── HERO SECTION ──────────────────────────────────────── */
.exam-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 60px; 
  position: relative;
  overflow: hidden;
}

.exam-hero::before,
.exam-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.exam-hero::before {
  width: 500px; height: 500px;
  top: -140px; right: -140px;
  background: radial-gradient(circle, rgba(30,99,233,.10), transparent 70%);
  animation: driftA 9s ease-in-out infinite alternate;
}
.exam-hero::after {
  width: 350px; height: 350px;
  bottom: -80px; left: -100px;
  background: radial-gradient(circle, rgba(212,175,55,.10), transparent 70%);
  animation: driftB 11s ease-in-out infinite alternate;
}

.exam-hero .container {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ── Logo ──────────────────────────────────────────────── */
.hero-logo {
  width: min(240px, 58vw);
  height: auto;
  display: block;
  object-fit: contain;
  margin-bottom: 32px;
  filter: drop-shadow(0 14px 30px rgba(15,61,145,.24));
  animation: logoFloat 5s ease-in-out infinite, revealUp .9s var(--ease) both;
}

/* ── Portal Tag ────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(15,61,145,.10), rgba(30,99,233,.07));
  color: var(--primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1.5px solid rgba(15,61,145,.18);
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(15,61,145,.10);
  animation: revealUp .9s .12s var(--ease) both;
}

.tag::before {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: livePulse 2s ease infinite;
}

/* ── Hero Heading ──────────────────────────────────────── */
.exam-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(36px, 7vw, 62px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -2px;
  color: var(--primary-dark);
  margin-bottom: 18px;
  animation: revealUp .9s .22s var(--ease) both;
}

/* ── Subtitle ──────────────────────────────────────────── */
.subtitle {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 38px;
  animation: revealUp .9s .32s var(--ease) both;
}

/* ── CTA Button ────────────────────────────────────────── */
.give-exam-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 52px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(30,99,233,.36), 0 4px 12px rgba(30,99,233,.20), inset 0 1px 0 rgba(255,255,255,.20);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  overflow: hidden;
  animation: revealUp .9s .42s var(--ease) both;
  width: auto;
  min-width: 0;
}

.give-exam-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.20), transparent 60%);
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.give-exam-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 54px rgba(30,99,233,.44), 0 8px 20px rgba(30,99,233,.24), inset 0 1px 0 rgba(255,255,255,.20);
}
.give-exam-btn:hover::before { opacity: 1; }
.give-exam-btn:active { transform: translateY(-1px); }

/* ── MODAL ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show { display: flex; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,12,30,.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .3s var(--ease) both;
  cursor: pointer;
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 490px;
  max-height: calc(98vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 100px rgba(5,12,30,.28), 0 0 0 1px rgba(255,255,255,.7) inset;
  animation: modalPop .44s var(--spring) both;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-box::-webkit-scrollbar       { width: 4px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-dark), var(--accent), var(--gold));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 2;
}

.modal-box h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: -.5px;
  margin-top: 0;
  padding: 12px 32px 0 32px; 
  padding-right: 60px;
}

.modal-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  padding: 6px 32px 18px 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

/* ── Close Button ──────────────────────────────────────── */
.close-btn {
  position: absolute;
  top: 10px; right: 16px; 
  z-index: 10;
  width: 36px; height: 36px;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: none;
}

.close-btn:hover {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 6px 18px rgba(229,57,53,.30);
}

/* ── Form ──────────────────────────────────────────────── */
.exam-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 32px 30px 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  color: #2a3a55;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.form-group label span { color: var(--error); }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: #f7faff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color .22s var(--ease), box-shadow .22s var(--ease), transform .22s var(--ease), background .22s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #b8c5da; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30,99,233,.13);
  transform: translateY(-1px);
}

.form-group input[readonly] {
  background: linear-gradient(135deg, #edf3ff, #f5f9ff);
  border-color: rgba(30,99,233,.28);
  color: var(--primary);
  font-weight: 700;
  cursor: default;
}
.form-group input[readonly]:focus { box-shadow: none; transform: none; }

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7c99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
  cursor: pointer;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.65;
}

/* ── Submit Button ─────────────────────────────────────── */
.submit-btn {
  position: relative;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(30,99,233,.30), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
  overflow: hidden;
  margin-top: 4px;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18), transparent);
  opacity: 0;
  transition: opacity .28s var(--ease);
}

.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(30,99,233,.38), inset 0 1px 0 rgba(255,255,255,.18); }
.submit-btn:hover::before { opacity: 1; }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Form Status ───────────────────────────────────────── */
.form-status {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .3s var(--ease), opacity .3s var(--ease), padding .3s var(--ease);
  padding: 0 14px;
}

.form-status.show { max-height: 80px; opacity: 1; padding: 12px 14px; }
.form-status.success { background: rgba(15,157,88,.08); color: var(--success); border: 1.5px solid rgba(15,157,88,.22); }
.form-status.error   { background: rgba(229,57,53,.07); color: var(--error);   border: 1.5px solid rgba(229,57,53,.20); }

/* ── SUCCESS POPUP ─────────────────────────────────────── */
.success-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5,12,30,.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.success-popup.show { display: flex; animation: fadeIn .3s var(--ease) both; }

.success-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 48px 36px 38px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 40px 100px rgba(5,12,30,.28), 0 0 0 1px rgba(255,255,255,.7) inset;
  animation: modalPop .45s var(--spring) both;
  overflow: hidden;
}

.success-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--success), #34d373, var(--gold));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.success-tick {
  width: 90px; height: 90px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 35%, #e6fdf2, #c0f5d8);
  box-shadow: 0 0 0 14px rgba(15,157,88,.09), 0 16px 36px rgba(15,157,88,.20);
  font-size: 40px;
  font-weight: 900;
  color: var(--success);
  animation: tickBounce .65s var(--spring) both;
}

.success-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--primary-dark);
  letter-spacing: -.5px;
  margin-bottom: 10px;
}

.success-card p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 30px;
}

.success-ok-btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(30,99,233,.28);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}

.success-ok-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(30,99,233,.36); }

/* ── Keyframes ─────────────────────────────────────────── */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-10px) rotate(.5deg); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalPop {
  0%   { opacity: 0; transform: translateY(32px) scale(.88); }
  100% { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes tickBounce {
  0%   { opacity: 0; transform: scale(.3) rotate(-25deg); }
  60%  { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0   rgba(30,99,233,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(30,99,233,.0); }
  100% { box-shadow: 0 0 0 0   rgba(30,99,233,.0); }
}
@keyframes driftA {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-30px,40px) scale(1.08); }
}
@keyframes driftB {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(40px,-30px) scale(1.1); }
}
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(70px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ── Utility ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ──────────────────────────────────────────────────────────
   RESPONSIVE — Tablet
   ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; width: 100%; }

  .exam-hero { padding: 30px 16px 50px; }

  .hero-logo { width: min(200px, 52vw); margin-bottom: 26px; }

  .tag { font-size: 11.5px; letter-spacing: 2.5px; padding: 10px 20px; }

  .exam-hero h1 { letter-spacing: -1.2px; }

  .subtitle { font-size: 15.5px; margin-bottom: 32px; }

  .give-exam-btn { width: 100%; max-width: 360px; padding: 17px 36px; }

  /* Modal → full screen on mobile */
  .modal {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
  }

  .modal-box {
    max-width: 100%;
    width: 100%;
    height: 100dvh; /* FORCED FULL HEIGHT */
    max-height: 100dvh; /* REMOVED THE 93dvh RESTRICTION */
    border-radius: 0; /* REMOVED ROUNDED CORNERS FOR FULL SCREEN */
    animation: sheetUp .42s var(--spring) both;
  }

  .modal-box::before { border-radius: 0; }

  /* Drag handle pill - REMOVED */
  .modal-box::after {
    display: none;
  }

  .modal-box h2       { padding: 24px 20px 0 20px; font-size: 20px; margin-top: 0; } 
  .modal-text         { padding: 6px 20px 18px 20px; }
  .exam-form          { padding: 0 20px 26px 20px; }
  
  .close-btn          { top: 16px; right: 16px; } 

  .form-group input,
  .form-group select,
  .form-group textarea { font-size: 16px; } /* prevent iOS zoom */

  /* Success */
  .success-popup { padding: 12px; }
  .success-card {
    max-width: 100%;
    padding: 40px 22px 30px;
    border-radius: var(--radius-xl) var(--radius-xl) var(--radius-md) var(--radius-md);
  }
  .success-tick   { width: 78px; height: 78px; font-size: 34px; }
  .success-card h3 { font-size: 22px; }
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE — Small Phone
   ────────────────────────────────────────────────────────── */
@media (max-width: 390px) {
  .exam-hero { padding: 24px 14px 40px; }
  .exam-hero h1 { font-size: 32px; letter-spacing: -1px; }
  .tag { font-size: 10.5px; letter-spacing: 2px; padding: 9px 16px; }
  .give-exam-btn { padding: 15px 28px; font-size: 13.5px; }
  .modal-box h2 { font-size: 18px; }
  .success-card { padding: 36px 18px 28px; }
  .success-card h3 { font-size: 20px; }
}