/* ============ VIQ English Placement Test — styles ============ */

:root{
  --viq-blue: #2276EC;
  --viq-blue-dark: #14367F;
  --viq-orange: #FF5A23;
  --viq-orange-light: #FFE7DC;
  --viq-blue-light: #E8F1FE;
  --gray-bg: #F4F8FD;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --border-color: #E2E8F0;
  --white: #FFFFFF;
  --success: #22B14C;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 8px 24px rgba(34, 118, 236, 0.08);
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #EAF3FF 0%, #F7FBFF 40%, #FFFFFF 100%);
  color: var(--text-dark);
  min-height: 100vh;
}

.app{
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ============ HEADER ============ */
.app-header{
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.app-header .logo{
  height: 64px;
  width: auto;
  flex-shrink: 0;
}
.header-title h1{
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
}
.txt-blue{ color: var(--viq-blue); }
.txt-orange{ color: var(--viq-orange); }
.subtitle{
  margin: 2px 0 0;
  color: var(--viq-blue-dark);
  font-weight: 600;
  font-size: 15px;
}
.header-title{ flex: 1; }
.header-restart-btn{
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  flex-shrink: 0;
}
.header-restart-btn:hover{
  border-color: var(--viq-orange);
  color: var(--viq-orange);
  background: var(--viq-orange-light);
}
.header-restart-icon{ font-size: 15px; }

/* ============ STEPPER ============ */
.stepper{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 26px 0 30px;
}
.step{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 92px;
}
.step-circle{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #D9E2EF;
  color: #8CA0BC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  transition: all .25s ease;
}
.step-label{
  font-size: 13px;
  font-weight: 700;
  color: #9AAAC1;
  white-space: nowrap;
}
.step.active .step-circle{
  background: var(--viq-blue);
  color: #fff;
  box-shadow: 0 0 0 5px var(--viq-blue-light);
}
.step.active .step-label{ color: var(--viq-blue); }
.step.done .step-circle{
  background: var(--viq-blue);
  color: #fff;
}
.step.done .step-label{ color: var(--viq-blue-dark); }
.step-line{
  flex: 0 0 90px;
  height: 3px;
  background: #D9E2EF;
  margin-bottom: 22px;
  border-radius: 2px;
}

@media (max-width: 640px){
  .step-line{ flex-basis: 36px; }
  .step{ min-width: 60px; }
  .step-label{ font-size: 11px; }
}

/* ============ CARD ============ */
.card{
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px;
}

.notice-bar{
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--viq-orange-light);
  color: var(--viq-blue-dark);
  font-weight: 700;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 26px;
  font-size: 15px;
}
.notice-icon{ font-size: 20px; }

/* ============ FORM (Screen 1) ============ */
.form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
}
.form-field{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-field label{
  font-weight: 700;
  font-size: 14.5px;
  color: var(--viq-blue-dark);
}
.req{ color: var(--viq-orange); }
.form-field input,
.form-field select{
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  background: var(--gray-bg);
  color: var(--text-dark);
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus,
.form-field select:focus{
  outline: none;
  border-color: var(--viq-blue);
  box-shadow: 0 0 0 3px var(--viq-blue-light);
  background: #fff;
}
.form-field input.invalid,
.form-field select.invalid{
  border-color: #E23636;
  background: #FFF4F4;
}
.error-msg{
  color: #E23636;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 14px;
}

@media (max-width: 700px){
  .form-grid{ grid-template-columns: 1fr; }
}

/* ============ BUTTONS ============ */
.btn{
  border: none;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 26px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  font-family: inherit;
}
.btn:active{ transform: translateY(1px) scale(0.99); }
.btn-primary{
  background: linear-gradient(135deg, var(--viq-orange) 0%, #FF7A47 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 90, 35, 0.35);
}
.btn-primary:hover{ box-shadow: 0 10px 22px rgba(255, 90, 35, 0.45); }
.btn-primary:disabled{
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-outline{
  background: #fff;
  color: var(--viq-blue);
  border: 2px solid var(--viq-blue);
}
.btn-outline:hover{ background: var(--viq-blue-light); }
.btn-lg{ padding: 16px 40px; font-size: 17px; }
.btn-sm{ padding: 9px 16px; font-size: 13px; white-space: nowrap; }
.arrow{ display: inline-block; }

.btn-row{ display: flex; margin-top: 30px; gap: 14px; }
.btn-row-center{ justify-content: center; }
.btn-row-between{ justify-content: space-between; }

@media (max-width: 480px){
  .btn-row-between{ flex-direction: column-reverse; }
  .btn-row-between .btn{ width: 100%; }
}

/* ============ READING SCREEN ============ */
.progress-row{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.progress-bar-track{
  flex: 1;
  height: 8px;
  background: #DCE6F7;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill{
  height: 100%;
  width: 10%;
  background: var(--viq-blue);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-label{
  font-weight: 700;
  color: var(--viq-blue-dark);
  font-size: 14px;
  white-space: nowrap;
}

.question-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.qnav-btn{
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: #fff;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
}
.qnav-btn:hover{ border-color: var(--viq-blue); }
.qnav-btn.active{
  background: var(--viq-blue);
  border-color: var(--viq-blue);
  color: #fff;
}
.qnav-btn.answered:not(.active){
  border-color: var(--success);
  color: var(--success);
}

.content-columns{
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px){
  .content-columns{ grid-template-columns: 1fr; }
}

.question-card{ min-height: 380px; }

.q-title{
  color: var(--viq-blue);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}
.q-instruction{
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 20px;
}
.q-passage{
  background: var(--gray-bg);
  border-left: 4px solid var(--viq-blue);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 22px;
}
.q-passage .blank-tag{
  display: inline-block;
  background: var(--viq-orange-light);
  color: var(--viq-orange);
  font-weight: 800;
  border-radius: 6px;
  padding: 0 6px;
  margin: 0 2px;
}
.q-image-wrap{
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.q-image-wrap img{
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.answer-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.answer-option{
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  background: var(--gray-bg);
  transition: all .15s ease;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-dark);
}
.answer-option:hover{
  border-color: var(--viq-blue);
  background: var(--viq-blue-light);
}
.answer-option.selected{
  border-color: var(--viq-blue);
  background: var(--viq-blue-light);
  box-shadow: 0 0 0 2px var(--viq-blue) inset;
}
.answer-radio{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #B7C4D9;
  flex-shrink: 0;
  position: relative;
  background: #fff;
}
.answer-option.selected .answer-radio{
  border-color: var(--viq-blue);
}
.answer-option.selected .answer-radio::after{
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--viq-blue);
}
.answer-letter{
  font-weight: 800;
  color: var(--viq-blue);
  width: 18px;
}

.side-nav-card{
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.side-nav-card h3{
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--viq-blue-dark);
}
.side-nav-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-nav-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-dark);
  transition: all .15s ease;
}
.side-nav-item:hover{ border-color: var(--viq-blue); }
.side-nav-item.active{
  border-color: var(--viq-blue);
  background: var(--viq-blue-light);
}
.side-nav-thumb{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--viq-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.side-nav-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.side-nav-item.answered-dot{ position: relative; }
.side-nav-check{
  margin-left: auto;
  color: var(--success);
  font-weight: 800;
  font-size: 14px;
}

/* ============ LISTENING SCREEN ============ */
.audio-card{ margin-bottom: 22px; }
.audio-player{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.audio-play-btn{
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--viq-blue);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.audio-play-btn:hover{ background: var(--viq-blue-dark); }
.audio-time{
  font-weight: 700;
  color: var(--viq-blue-dark);
  font-size: 13.5px;
  min-width: 34px;
}
.audio-track{
  flex: 1;
  min-width: 120px;
  height: 8px;
  background: #DCE6F7;
  border-radius: 999px;
  overflow: hidden;
}
.audio-track-fill{
  height: 100%;
  width: 0%;
  background: var(--viq-orange);
  border-radius: 999px;
}

.listening-question-card{ margin-bottom: 22px; }
.l-qnum-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--viq-blue);
  color: #fff;
  font-weight: 800;
  margin-right: 12px;
}
.l-qtext{
  font-size: 19px;
  font-weight: 800;
  color: var(--viq-blue-dark);
  display: inline-flex;
  align-items: center;
  margin-bottom: 24px;
}

.picture-options{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 700px){
  .picture-options{ grid-template-columns: 1fr; }
}
.picture-option{
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  text-align: center;
  background: var(--gray-bg);
  transition: all .15s ease;
}
.picture-option:hover{ border-color: var(--viq-blue); }
.picture-option.selected{
  border-color: var(--viq-blue);
  background: var(--viq-blue-light);
  box-shadow: 0 0 0 2px var(--viq-blue) inset;
}
.picture-option img{
  width: 100%;
  height: 150px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: #fff;
  padding: 6px;
}
.picture-option-letter{
  font-weight: 800;
  color: var(--viq-blue-dark);
  font-size: 16px;
  margin-bottom: 8px;
}
.picture-option-radio{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #B7C4D9;
  margin: 0 auto;
  position: relative;
  background: #fff;
}
.picture-option.selected .picture-option-radio{ border-color: var(--viq-blue); }
.picture-option.selected .picture-option-radio::after{
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--viq-blue);
}

/* ============ DONE SCREEN ============ */
.done-card{
  text-align: center;
  padding: 60px 32px;
}
.done-icon{ font-size: 56px; margin-bottom: 16px; }
.done-card h2{
  color: var(--viq-blue);
  font-size: 28px;
  margin: 0 0 12px;
}
.done-card p{
  font-size: 16px;
  color: var(--text-dark);
  margin: 6px 0;
}
.done-sub{ color: var(--text-muted); font-size: 14.5px; }

.score-box{
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--viq-blue-light);
  border-radius: var(--radius-md);
  padding: 16px 28px;
  margin: 16px 0 20px;
}
.score-label{
  font-size: 14px;
  font-weight: 700;
  color: var(--viq-blue-dark);
}
.score-value{
  font-size: 32px;
  font-weight: 800;
  color: var(--viq-blue);
}
.score-sub{
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ============ FOOTER ============ */
.app-footer{
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.copyright{
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============ MODAL ============ */
.modal-overlay[hidden]{ display: none !important; }
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(20, 54, 127, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}
.modal-box{
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 34px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-icon{ font-size: 40px; margin-bottom: 10px; }
.modal-box h3{
  margin: 0 0 10px;
  color: var(--viq-blue-dark);
  font-size: 19px;
}
.modal-box p{
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 6px;
}
