html { scroll-behavior: smooth; }
.home-page { background: #f5f8ff; }
.home-page .page-shell { width: 100%; max-width: none; margin: 0; }
.home-page .topbar { background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); }
.home-page .topbar .public-nav { display: flex; }
.login-button { gap: 7px; color: #fff; background: #172b4d; }
.login-button:hover { background: #0f1e36; }
.login-lock { font-size: 15px; line-height: 1; }

.home-hero { display: grid; place-items: center; min-height: min(620px, calc(100vh - 69px)); padding: 70px 24px; color: #fff; text-align: center; background: radial-gradient(circle at 50% 15%, rgba(96, 165, 250, .3), transparent 34%), linear-gradient(140deg, #0f2748 0%, #154f91 55%, #2563eb 100%); overflow: hidden; }
.home-hero__content { width: min(780px, 100%); }
.home-kicker { display: inline-block; margin-bottom: 18px; padding: 7px 13px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #dbeafe; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.home-hero h1 { margin-bottom: 18px; font-size: clamp(38px, 6vw, 68px); line-height: 1.05; letter-spacing: -.045em; }
.home-hero p { max-width: 660px; margin: 0 auto; color: #dbeafe; font-size: clamp(17px, 2vw, 21px); line-height: 1.65; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 650px; margin: 38px auto 0; }
.home-button { display: flex; align-items: center; gap: 13px; min-height: 84px; padding: 16px 18px; border: 1px solid rgba(255,255,255,.3); border-radius: 16px; text-align: left; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.home-button:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(4,16,36,.24); }
.home-button--primary { color: #12325c; background: #fff; }
.home-button--secondary { color: #fff; background: rgba(255,255,255,.12); }
.home-button__icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: #2563eb; font-size: 21px; font-weight: 900; }
.home-button--secondary .home-button__icon { color: #173c6d; background: #dbeafe; }
.home-button strong, .home-button small { display: block; }
.home-button strong { font-size: 16px; }
.home-button small { margin-top: 4px; opacity: .75; }

.home-section { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0; scroll-margin-top: 76px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.section-number { display: inline-block; margin-bottom: 9px; color: var(--primary); font-size: 13px; font-weight: 900; letter-spacing: .1em; }
.exam-count { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; color: #175cd3; background: #eaf2ff; font-size: 13px; font-weight: 800; }
.exam-code-panel { margin-bottom: 26px; padding: 22px; border: 1px solid #dbe4f0; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.exam-code-form label { margin-bottom: 9px; }
.exam-code-control { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.exam-code-control input { min-height: 46px; text-transform: uppercase; }
.exam-code-form small { display: block; margin-top: 8px; color: var(--muted); }
.home-exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.home-exam-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid #dbe4f0; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,40,.05); }
.home-exam-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-exam-card h3 { margin: 18px 0 8px; font-size: 20px; }
.home-exam-card > p { flex: 1; color: var(--muted); line-height: 1.55; }
.exam-code-label { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 800; }
.exam-meta { display: flex; gap: 18px; margin: 8px 0 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.exam-meta b { color: #101828; }
.exam-schedule { margin: -5px 0 13px; color: #475467; font-size: 13px; }
.button.disabled { color: #667085; background: #e9edf3; cursor: not-allowed; }
.button.disabled:hover { transform: none; }
.empty-exams { padding: 46px 24px; border: 1px dashed #b8c7da; border-radius: 18px; text-align: center; background: rgba(255,255,255,.65); }
.empty-exams > span { font-size: 30px; }
.empty-exams h3 { margin: 12px 0 7px; }
.empty-exams p { margin: 0; color: var(--muted); }

.rules-section { width: 100%; max-width: none; padding-right: max(20px, calc((100% - 1120px) / 2)); padding-left: max(20px, calc((100% - 1120px) / 2)); background: #fff; }
.rules-section .section-heading { max-width: 760px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rules-grid li { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.rules-grid li > span { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; background: #172b4d; font-weight: 900; }
.rules-grid strong { display: block; margin: 3px 0 7px; }
.rules-grid p { margin: 0; color: var(--muted); line-height: 1.55; }
.rules-back-link { display: inline-flex; gap: 8px; margin-top: 24px; color: var(--primary); font-weight: 800; }
.home-page .footer { justify-content: center; width: 100%; margin: 0; padding: 24px max(20px, calc((100% - 1120px) / 2)); background: #fff; border-top: 1px solid var(--line); text-align: center; }

@media (max-width: 850px) {
    .home-exam-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px) {
    .home-page .topbar { position: sticky; align-items: center; padding: 11px 16px; }
    .home-page .brand small, .home-page .topbar nav > a:first-child, .login-button > span:last-child { display: none; }
    .login-button { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
    .home-hero { min-height: auto; padding: 62px 18px; }
    .home-actions, .home-exam-grid, .rules-grid { grid-template-columns: 1fr; }
    .home-button { min-height: 76px; }
    .home-section { width: min(100% - 28px, 1120px); padding: 54px 0; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
    .exam-code-panel { padding: 16px; }
    .exam-code-control { grid-template-columns: 1fr; }
    .exam-code-control .button { width: 100%; }
    .rules-section { width: 100%; padding-right: 14px; padding-left: 14px; }
    .home-page .footer { align-items: center; padding: 22px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .home-button, .button { transition: none; }
}
