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

:root {
  --bg-page: #FFFBEB;
  --bg-card: #FFFFFF;
  --pastel-yellow: #FEF3C7;
  --pastel-yellow-hover: #FDE68A;
  --accent: #F59E0B;
  --accent-dark: #B45309;
  --border-soft: #FCD34D;
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --success-bg: #DCFCE7;
  --success-text: #166534;
  --danger-bg: #FEE2E2;
  --danger-text: #991B1B;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, #fdf7c7 10%, #f5ecb3 50%);
  border: 2px solid var(--border-soft);
  border-radius: 20px;
  padding: 40px 28px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.12);
  margin-bottom: 32px;
}

.hero-badge {
  display: inline-block;
  background: #FFFFFF;
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
  border: 1px solid var(--border-soft);
}

.hero-banner h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.hero-banner p {
  max-width: 680px;
  margin: 0 auto;
  color: #4B5563;
  font-size: 1.05rem;
}

/* Card & Form Layout */
.card {
  background: var(--bg-card);
  border: 1.5px solid #FDE68A;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.06);
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px dashed #FDE68A;
}

.student-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 720px) {
  .student-setup-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-banner h1 {
    font-size: 1.5rem;
  }
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background-color: #FFFDF7;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Grade Selection: 6 7 (cách xa) 8 9 / xuống dòng 10 11 (cách xa) 12 */
.grade-picker-wrapper {
  background: var(--bg-page);
  border: 1.5px solid #FDE68A;
  border-radius: 14px;
  padding: 18px;
}

.grade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.grade-row:last-child {
  margin-bottom: 0;
}

.grade-pair {
  display: flex;
  gap: 10px;
}

.grade-option input[type="radio"] {
  display: none;
}

.grade-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 48px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 2px solid #FCD34D;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.grade-box:hover {
  background: var(--pastel-yellow);
  transform: translateY(-2px);
}

.grade-option input[type="radio"]:checked + .grade-box {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.grade-spacer {
  width: 54px;
  height: 48px;
  visibility: hidden;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--pastel-yellow);
  color: var(--accent-dark);
  border: 1.5px solid var(--border-soft);
}

.btn-secondary:hover {
  background: var(--pastel-yellow-hover);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.88rem;
  border-radius: 8px;
}

.next-action-bar {
  margin-top: 24px;
  text-align: right;
}

/* Alerts & Badges */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 600;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #FCA5A5;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #86EFAC;
}

/* Quiz Styles */
.student-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--pastel-yellow);
  padding: 14px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--border-soft);
  margin-bottom: 24px;
}

.question-block {
  background: #FFFDF7;
  border: 1.5px solid #FDE68A;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}

.question-title {
  font-weight: 700;
  font-size: 1.06rem;
  margin-bottom: 12px;
}

.mcq-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .mcq-list {
    grid-template-columns: 1fr;
  }
}

.mcq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
}

.mcq-item:hover {
  border-color: var(--accent);
  background: #FFFBEB;
}

.mcq-item input[type="radio"] {
  accent-color: var(--accent-dark);
  width: 18px;
  height: 18px;
}

/* Tables for Teacher */
.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #FDE68A;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--pastel-yellow);
  color: var(--accent-dark);
  font-weight: 800;
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid #FDE68A;
  margin-top: 40px;
}

footer a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}