/* =====================================================
   Intersmart Exam - Frontend Styles
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --ise-primary:   #ffcf15;
  --ise-primary-h: #e6b800;
  --ise-success:   #059669;
  --ise-danger:    #dc2626;
  --ise-warning:   #d97706;
  --ise-info:      #0284c7;
  --ise-bg:        #fffdf0;
  --ise-card:      #ffffff;
  --ise-border:    #ffe97a;
  --ise-text:      #1e293b;
  --ise-muted:     #64748b;
  --ise-radius:    14px;
  --ise-shadow:    0 4px 24px rgba(255,207,21,.18), 0 1.5px 6px rgba(0,0,0,.06);
  --ise-font:      'Nunito', sans-serif;
}

* { box-sizing: border-box; }

#ise-wrap {
  font-family: var(--ise-font);
  color: var(--ise-text);
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px;
  min-height: 400px;
}

/* ─── Steps ─── */
.ise-step { display: none; }
.ise-step.active { display: block; animation: iseFadeIn .35s ease; }
@keyframes iseFadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

/* ─── Register Card ─── */
.ise-register-card {
  background: var(--ise-card);
  border-radius: var(--ise-radius);
  box-shadow: var(--ise-shadow);
  padding: 48px 40px;
  max-width: 480px;
  margin: 0 auto;
  border: 1px solid var(--ise-border);
}
.ise-logo-area { text-align: center; margin-bottom: 32px; }
.ise-logo-icon { font-size: 52px; margin-bottom: 10px; }
.ise-exam-title { font-size: 1.7rem; font-weight: 900; margin: 0 0 6px; color: #92700a; }
.ise-subtitle { color: var(--ise-muted); font-size: .95rem; margin: 0; }

.ise-form-group { margin-bottom: 20px; }
.ise-form-group label {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: var(--ise-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.ise-form-group input[type="text"],
.ise-form-group input[type="tel"],
.ise-form-group input[type="number"],
.ise-form-group textarea,
.ise-form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--ise-border);
  border-radius: 10px;
  font-family: var(--ise-font);
  font-size: 1rem;
  color: var(--ise-text);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  background: #f8fafc;
}
.ise-form-group input:focus,
.ise-form-group textarea:focus,
.ise-form-group select:focus {
  border-color: var(--ise-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
  background: #fff;
}
.ise-field-error { color: var(--ise-danger); font-size: .82rem; margin-top: 4px; display: block; min-height: 18px; font-weight: 600; }
.ise-phone-wrap { display: flex; align-items: center; gap: 0; }
.ise-phone-prefix {
  background: var(--ise-primary);
  color: #1a1200;
  padding: 12px 14px;
  border-radius: 10px 0 0 10px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  border: 2px solid var(--ise-primary);
}
.ise-phone-wrap input {
  border-radius: 0 10px 10px 0 !important;
  border-left: none !important;
  flex: 1;
}
.ise-register-note { text-align:center; color:var(--ise-muted); font-size:.8rem; margin-top:14px; }

/* ─── Buttons ─── */
.ise-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  font-family: var(--ise-font);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}
.ise-btn-primary { background: var(--ise-primary); color: #1a1200; width: 100%; justify-content: center; }
.ise-btn-primary:hover { background: var(--ise-primary-h); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,207,21,.4); }
.ise-btn-secondary { background: #fff9db; color: #92700a; }
.ise-btn-secondary:hover { background: var(--ise-primary); color: #1a1200; }
.ise-btn-success { background: var(--ise-success); color: #fff; padding: 15px 40px; font-size: 1.05rem; }
.ise-btn-success:hover { background: #047857; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(5,150,105,.3); }
.ise-btn-ghost { background: transparent; color: var(--ise-muted); border: 2px solid var(--ise-border); }
.ise-btn-ghost:hover { border-color: var(--ise-primary); color: var(--ise-primary); }
.ise-btn-lg { padding: 16px 36px; font-size: 1.1rem; }

/* ─── Instructions ─── */
.ise-instructions-card {
  background: var(--ise-card);
  border-radius: var(--ise-radius);
  box-shadow: var(--ise-shadow);
  padding: 40px;
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid var(--ise-border);
}
.ise-inst-header { text-align: center; margin-bottom: 28px; }
.ise-inst-icon { font-size: 44px; margin-bottom: 10px; }
.ise-inst-header h2 { font-size: 1.6rem; font-weight: 900; margin: 0 0 6px; }
.ise-inst-subtitle { color: var(--ise-muted); margin: 0; }
.ise-inst-body {
  background: #f8fafc;
  border-radius: 10px;
  padding: 20px 24px;
  line-height: 1.85;
  font-size: .97rem;
  margin-bottom: 20px;
  border: 1px solid var(--ise-border);
}
.ise-inst-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ise-inst-meta-item {
  flex: 1;
  min-width: 120px;
  background: #fff9db;
  border-radius: 10px;
  padding: 14px 18px;
  text-align: center;
}
.ise-inst-meta-item .ise-meta-num { font-size: 1.4rem; font-weight: 900; color: #92700a; }
.ise-inst-meta-item .ise-meta-label { font-size: .78rem; color: var(--ise-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ise-warning-box {
  display: flex;
  gap: 12px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: .92rem;
  margin-bottom: 24px;
  color: #92400e;
}
.ise-warning-box span { font-size: 1.4rem; flex-shrink: 0; }

/* ─── Exam Topbar ─── */
.ise-exam-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ise-card);
  border-radius: var(--ise-radius);
  box-shadow: var(--ise-shadow);
  padding: 14px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--ise-border);
  flex-wrap: wrap;
  gap: 10px;
}
.ise-exam-name-tag {
  background: #fff9db;
  color: #92700a;
  font-weight: 800;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .92rem;
}
.ise-score-display { font-weight: 700; font-size: .95rem; color: var(--ise-muted); }
.ise-score-display strong { color: var(--ise-text); font-size: 1.1rem; }
.ise-timer-wrap { text-align: center; }
.ise-timer-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ise-muted); font-weight: 700; }
.ise-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 600;
  color: #92700a;
  letter-spacing: .05em;
}
.ise-timer.ise-timer-warning { color: var(--ise-warning); animation: isePulse 1s infinite; }
.ise-timer.ise-timer-danger  { color: var(--ise-danger);  animation: isePulse .5s infinite; }
@keyframes isePulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ─── Progress ─── */
.ise-progress-bar-outer {
  background: var(--ise-border);
  border-radius: 99px;
  height: 7px;
  margin-bottom: 6px;
  overflow: hidden;
}
.ise-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--ise-primary), #ffe97a);
  border-radius: 99px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.ise-progress-text { font-size: .82rem; color: var(--ise-muted); font-weight: 600; margin-bottom: 20px; }

/* ─── Question Card ─── */
.ise-question-card {
  background: var(--ise-card);
  border-radius: var(--ise-radius);
  box-shadow: var(--ise-shadow);
  padding: 32px;
  margin-bottom: 20px;
  border: 1px solid var(--ise-border);
  animation: iseFadeIn .25s ease;
}
.ise-question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.ise-q-num {
  background: var(--ise-primary);
  color: #1a1200;
  font-size: .8rem;
  font-weight: 800;
  border-radius: 7px;
  padding: 4px 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ise-q-marks {
  background: #fef3c7;
  color: #92400e;
  font-size: .8rem;
  font-weight: 800;
  border-radius: 7px;
  padding: 4px 12px;
}
.ise-q-time {
  background: #e0f2fe;
  color: #0369a1;
  font-size: .8rem;
  font-weight: 700;
  border-radius: 7px;
  padding: 4px 12px;
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}
.ise-question-text {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 24px;
  color: var(--ise-text);
}
.ise-options { display: flex; flex-direction: column; gap: 10px; }
.ise-option-label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--ise-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
  font-weight: 600;
  background: #f8fafc;
}
.ise-option-label:hover { border-color: var(--ise-primary); background: #fff9db; }
.ise-option-label input[type="radio"] { display: none; }
.ise-option-label.selected {
  border-color: var(--ise-primary);
  background: #fff9db;
  color: #92700a;
}
.ise-option-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ise-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .85rem;
  flex-shrink: 0;
  transition: all .18s;
}
.ise-option-label.selected .ise-option-key {
  background: var(--ise-primary);
  color: #1a1200;
}

/* ─── Navigation ─── */
.ise-exam-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ise-nav-dots { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: center; }
.ise-nav-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 0;
  background: var(--ise-border);
  color: transparent;
  transition: all .15s;
}
.ise-nav-dot.answered { background: var(--ise-success); color: #fff; }
.ise-nav-dot.current  { background: var(--ise-primary); color: #1a1200; transform: scale(1.2); }
.ise-submit-area { text-align: center; padding: 10px 0 30px; }

/* ─── Results ─── */
.ise-results-card {
  background: var(--ise-card);
  border-radius: var(--ise-radius);
  box-shadow: var(--ise-shadow);
  overflow: hidden;
  border: 1px solid var(--ise-border);
}
.ise-result-header {
  padding: 48px 40px 32px;
  text-align: center;
  background: linear-gradient(135deg, #ffcf15, #ffe97a);
  color: #1a1200;
}
.ise-result-header.ise-result-fail { background: linear-gradient(135deg, #dc2626, #9f1239); color: #fff; }
.ise-result-header.ise-result-zeroed { background: linear-gradient(135deg, #374151, #111827); color: #fff; }
.ise-result-emoji { font-size: 52px; margin-bottom: 10px; }
.ise-result-header h2 { font-size: 1.6rem; font-weight: 900; margin: 0 0 20px; }
.ise-score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: 4px solid rgba(255,255,255,.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.ise-score-num { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.ise-score-label { font-size: .78rem; opacity: .85; font-weight: 600; }
.ise-score-percent { font-size: 2.6rem; font-weight: 900; margin-bottom: 14px; }
.ise-result-badge {
  display: inline-block;
  background: rgba(255,255,255,.55);
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 99px;
  padding: 6px 22px;
  font-weight: 900;
  letter-spacing: .08em;
  font-size: .95rem;
  color: #1a1200;
}
.ise-result-stats {
  padding: 24px 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ise-border);
}
.ise-result-stat {
  flex: 1;
  min-width: 100px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.ise-result-stat-num { font-size: 1.4rem; font-weight: 900; color: #92700a; }
.ise-result-stat-label { font-size: .75rem; color: var(--ise-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ─── Answer Review ─── */
.ise-answer-review { padding: 24px 32px; }
.ise-answer-review h3 { font-weight: 900; margin: 0 0 16px; font-size: 1.05rem; }
.ise-all-correct { text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--ise-success); padding: 20px 0; margin: 0; }
.ise-answer-item {
  border-radius: 10px;
  border: 1.5px solid var(--ise-border);
  padding: 14px 18px;
  margin-bottom: 10px;
  font-size: .9rem;
}
.ise-answer-item.correct { border-color: #6ee7b7; background: #ecfdf5; }
.ise-answer-item.wrong   { border-color: #fca5a5; background: #fff1f2; }
.ise-answer-q { font-weight: 700; margin-bottom: 8px; }
.ise-answer-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.ise-answer-pill {
  border-radius: 7px;
  padding: 4px 12px;
  font-size: .8rem;
  font-weight: 700;
}
.ise-pill-student { background: #e0e7ff; color: #3730a3; }
.ise-pill-correct { background: #d1fae5; color: #065f46; }
.ise-pill-marks   { background: #fef9c3; color: #713f12; }

/* ─── Modal ─── */
.ise-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: iseFadeIn .2s ease;
}
.ise-modal-content {
  background: #fff;
  border-radius: 18px;
  padding: 44px 40px;
  max-width: 440px;
  width: calc(100% - 32px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: iseSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}
.ise-modal-warning .ise-modal-icon { font-size: 56px; margin-bottom: 14px; }
.ise-modal-content h3 { font-size: 1.35rem; font-weight: 900; margin: 0 0 12px; }
.ise-modal-content p  { color: var(--ise-muted); margin: 0 0 24px; line-height: 1.6; }
@keyframes iseSlideUp { from{transform:translateY(24px);opacity:0} to{transform:none;opacity:1} }

@media (max-width: 600px) {
  .ise-register-card, .ise-instructions-card { padding: 28px 20px; }
  .ise-question-card { padding: 20px; }
  .ise-exam-topbar { flex-direction: column; text-align: center; }
  .ise-result-header { padding: 32px 20px 24px; }
  .ise-answer-review { padding: 16px; }
  .ise-result-stats { padding: 16px; }
}

/* ─── Exam Closed Notice ─── */
.ise-closed-notice {
  background: var(--ise-card);
  border-radius: var(--ise-radius);
  box-shadow: var(--ise-shadow);
  border: 2px solid var(--ise-border);
  padding: 60px 40px;
  max-width: 480px;
  margin: 40px auto;
  text-align: center;
}
.ise-closed-icon { font-size: 56px; margin-bottom: 16px; }
.ise-closed-notice h2 { font-size: 1.5rem; font-weight: 900; color: #92700a; margin: 0 0 12px; }
.ise-closed-notice p { color: var(--ise-muted); font-size: .97rem; margin: 0; line-height: 1.7; }
