:root {
  --bg: #0f172a;
  --bg-soft: #111c34;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: #ffffff;
  --text: #f8fafc;
  --text-dark: #162033;
  --muted: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #e2e8f0;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --success-hover: #15803d;
  --warning: #f59e0b;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(135deg, #0b1223 0%, #16233f 50%, #0f172a 100%);
  color: var(--text);
  min-height: 100%;
}

body {
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.fade-in {
  animation: fadeIn 0.45s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.background-shapes::before,
.background-shapes::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.33;
  z-index: 0;
}

.background-shapes::before {
  width: 270px;
  height: 270px;
  background: #0ea5e9;
  top: 9%;
  left: 7%;
}

.background-shapes::after {
  width: 290px;
  height: 290px;
  background: #14b8a6;
  bottom: 6%;
  right: 8%;
}

.landing-page,
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 28px 0;
}

.hero-card,
.panel,
.question-card,
.modal-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  width: min(920px, 100%);
  padding: 42px 34px;
  text-align: center;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.logo-circle {
  width: 174px;
  height: 174px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-image-circle {
  background: rgba(255, 255, 255, 0.96);
  border: 6px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.department-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.eyebrow {
  color: #93c5fd;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.hero-card h1,
.panel-header h1,
.result-header-center h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.2;
}

.hero-text,
.panel-header p,
.student-preview,
.hint-box,
#examStudentInfo,
.result-list,
.result-status-card small,
.result-score-card small {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 28px;
}

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-lg {
  min-width: 185px;
  padding: 15px 24px;
  font-size: 1.06rem;
}

.full-width {
  width: 100%;
}

.auth-panel,
.verify-panel,
.result-panel {
  width: min(780px, 100%);
  padding: 32px;
}

.panel-header {
  margin-bottom: 24px;
}

.result-header-center {
  text-align: center;
}

.back-link {
  color: #bfdbfe;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group,
.verify-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  gap: 8px;
}

.form-group.full-width,
.full-width {
  grid-column: 1 / -1;
}

.form-group label,
.verify-form label {
  font-weight: 700;
}

.form-group input,
.form-group select,
.verify-form input {
  width: 100%;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.form-group input::placeholder,
.verify-form input::placeholder {
  color: #cbd5e1;
}

.form-group input:focus,
.form-group select:focus,
.verify-form input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.form-group select option {
  color: #111827;
}

.error-text {
  color: #fecaca;
  min-height: 18px;
  font-size: 0.88rem;
}

.student-preview,
.hint-box,
.result-item,
.info-chip {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.student-preview {
  margin-bottom: 18px;
}

.verify-form {
  gap: 10px;
}

.verify-form input {
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 4px;
}

.hint-box {
  margin: 10px 0 8px;
}

.exam-body {
  background: linear-gradient(135deg, #09101f 0%, #10192e 40%, #0c1425 100%);
}

.exam-header {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 10px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.exam-header h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.exam-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.timer-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 18px;
  text-align: center;
  min-width: 100px;
}

.timer-box span {
  display: block;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.timer-box strong {
  font-size: 1.2rem;
}

.exam-layout {
  padding: 14px 0 30px;
}

.exam-panel {
  padding: 26px;
}

.exam-warning-bar {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  line-height: 1.6;
}

.progress-row {
  margin-bottom: 18px;
}

.progress-text {
  margin-bottom: 10px;
  font-weight: 700;
  color: #dbeafe;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  transition: width 0.25s ease;
}

.question-card {
  padding: 24px;
}

.question-meta {
  margin-bottom: 10px;
  color: #93c5fd;
  font-weight: 700;
}

.question-card h2 {
  margin: 0 0 22px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.5;
}

.answers-list {
  display: grid;
  gap: 14px;
}

.answer-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.answer-item:hover {
  border-color: rgba(147, 197, 253, 0.55);
  transform: translateY(-1px);
}

.answer-item.selected {
  border-color: rgba(96, 165, 250, 0.95);
  background: rgba(37, 99, 235, 0.18);
}

.answer-item input {
  margin-top: 3px;
}

.exam-footer-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

.locked-state {
  opacity: 0.5;
  pointer-events: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  width: min(460px, 100%);
  padding: 24px;
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.danger-modal {
  border-color: rgba(239, 68, 68, 0.35);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.result-score-card,
.result-status-card {
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.result-score-card span,
.result-status-card span {
  display: block;
  color: #bfdbfe;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-score-card strong,
.result-status-card strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 6px;
}

.result-status-card.success-state {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
}

.result-status-card.fail-state {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.result-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.result-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.result-item strong {
  color: #fff;
}

.result-badge {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.result-badge.correct {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.result-badge.wrong {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .exam-header {
    flex-direction: column;
    align-items: stretch;
  }

  .exam-actions {
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .hero-card,
  .auth-panel,
  .verify-panel,
  .result-panel,
  .exam-panel,
  .question-card,
  .modal-card {
    padding: 22px;
  }

  .form-grid,
  .result-summary-grid {
    grid-template-columns: 1fr;
  }

  .logo-circle {
    width: 146px;
    height: 146px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 20px, 1000px);
  }

  .hero-card h1,
  .panel-header h1,
  .result-header-center h1 {
    font-size: 1.6rem;
  }

  .exam-footer-actions,
  .modal-actions,
  .result-item {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .btn-lg {
    width: 100%;
  }
}


select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    background: #fff;
    color: #f8fafc;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: all 0.25s ease;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2360a5fa' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

select:hover {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: #60a5fa;
}

select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

select option {
    background-color: #fff;
    color: #f8fafc;
    padding: 12px;
}

select:invalid {
    color: #94a3b8;
}


/* ===== Form field final fixes ===== */
.form-group input,
.form-group select,
.verify-form input,
input,
select,
textarea {
    background-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

input.is-filled,
select.is-filled,
textarea.is-filled,
.form-group input.is-filled,
.form-group select.is-filled,
.form-group textarea.is-filled,
#fullName.is-filled,
#groupNumber.is-filled,
#course.is-filled,
#semester.is-filled,
#teacher_select.is-filled,
#subject_select.is-filled {
    background: #eaf2ff !important;
    background-color: #eaf2ff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    border-color: #dbeafe !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

input.is-filled::placeholder,
textarea.is-filled::placeholder {
    color: #475569 !important;
    opacity: 1 !important;
}

select option,
.form-group select option,
#course option,
#semester option,
#teacher_select option,
#subject_select option {
    background-color: #ffffff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    opacity: 1 !important;
    font-weight: 500 !important;
}

input.is-filled:focus,
select.is-filled:focus,
textarea.is-filled:focus,
.form-group input.is-filled:focus,
.form-group select.is-filled:focus,
.form-group textarea.is-filled:focus {
    background: #eaf2ff !important;
    background-color: #eaf2ff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    border-color: #60a5fa !important;
    opacity: 1 !important;
}

/* ===== Exam question visibility improvement ===== */

/* Հարցի ամբողջ բլոկ */
.exam-card,
.question-card,
.question-box,
.quiz-card,
.exam-container,
.test-container {
    background: rgba(58, 66, 84, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Հարցի համար / progress */
.question-progress,
.exam-progress,
.step-text,
.progress-text {
    color: #93c5fd !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
}

/* Հարցի տեքստ */
.question-title,
.question-text,
.exam-question,
.quiz-question,
h2.question,
h3.question {
    color: #f8fafc !important;
    font-weight: 800 !important;
    line-height: 1.45 !important;
    font-size: 2rem !important;
}

/* Պատասխանների container */
.answers-list,
.options-list,
.question-options,
.answers,
.options {
    gap: 14px !important;
}

/* Ընդհանուր տարբերակների տեսք */
.answer-option,
.option-item,
.option,
.answer-item,
.answers label,
.options label,
.question-options label {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 20px !important;
    color: #f8fafc !important;
    padding: 20px 24px !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

/* Hover */
.answer-option:hover,
.option-item:hover,
.option:hover,
.answer-item:hover,
.answers label:hover,
.options label:hover,
.question-options label:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
    transform: translateY(-1px);
}

/* Եթե label-ի մեջ input կա */
.answer-option input[type="radio"],
.option-item input[type="radio"],
.option input[type="radio"],
.answer-item input[type="radio"],
.answers label input[type="radio"],
.options label input[type="radio"],
.question-options label input[type="radio"] {
    accent-color: #38bdf8 !important;
    transform: scale(1.2);
}

/* Checked radio-ի label-ը՝ modern browser-ների համար */
.answer-option:has(input[type="radio"]:checked),
.option-item:has(input[type="radio"]:checked),
.option:has(input[type="radio"]:checked),
.answer-item:has(input[type="radio"]:checked),
.answers label:has(input[type="radio"]:checked),
.options label:has(input[type="radio"]:checked),
.question-options label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25) !important;
}

/* Checked տարբերակի ներսի տեքստը */
.answer-option:has(input[type="radio"]:checked) *,
.option-item:has(input[type="radio"]:checked) *,
.option:has(input[type="radio"]:checked) *,
.answer-item:has(input[type="radio"]:checked) *,
.answers label:has(input[type="radio"]:checked) *,
.options label:has(input[type="radio"]:checked) *,
.question-options label:has(input[type="radio"]:checked) * {
    color: #ffffff !important;
}

/* Եթե radio-ից հետո կա span/div՝ պատասխան տեքստի համար */
.answer-option span,
.option-item span,
.option span,
.answer-item span,
.answers label span,
.options label span,
.question-options label span,
.answer-option div,
.option-item div,
.option div,
.answer-item div,
.answers label div,
.options label div,
.question-options label div {
    color: inherit !important;
    font-weight: 600 !important;
}

/* Փոքր էկրանների համար */
@media (max-width: 768px) {
    .question-title,
    .question-text,
    .exam-question,
    .quiz-question,
    h2.question,
    h3.question {
        font-size: 1.5rem !important;
    }

    .answer-option,
    .option-item,
    .option,
    .answer-item,
    .answers label,
    .options label,
    .question-options label {
        font-size: 1rem !important;
        padding: 16px 18px !important;
    }
}
