:root {
    --sai-orange: #f05b40;
    --sai-orange-deep: #cc554d;
    --sai-orange-50: #fff1ee;
    --sai-n50: #ffffff;
    --sai-n100: #f4f5f7;
    --sai-n200: #e8eaee;
    --sai-n500: #6b7280;
    --sai-n600: #4a5565;
    --sai-n700: #364153;
    --sai-n800: #1e293b;
    --sai-n900: #0f172a;
    --sai-ok: #0f766e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body.set-body {
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    color: var(--sai-n800);
    background: var(--sai-n50);
    line-height: 1.5;
}
a { color: var(--sai-orange); }
img { max-width: 100%; display: block; }
.set-wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
@supports (padding: max(0px)) {
    body.set-body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

.set-brand { display: inline-flex; align-items: center; text-decoration: none; }
.set-brand img { height: 48px; width: auto; }
.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.btn, .border-btn, #search_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
    font-family: inherit;
    transition: 0.2s ease;
}
.btn-orange, .border-btn {
    background: var(--sai-orange);
    color: #fff;
}
.btn-orange:hover, .border-btn:hover {
    background: transparent;
    border-color: var(--sai-orange);
    color: var(--sai-orange);
}
.btn-soft {
    background: var(--sai-n100);
    color: var(--sai-n600);
}
.btn-soft:hover { background: #e5e7eb; color: var(--sai-n800); }
.btn-white {
    background: #fff;
    color: var(--sai-n900);
}
@media (hover: none) {
    .btn-orange:hover, .border-btn:hover {
        background: var(--sai-orange);
        color: #fff;
        border-color: transparent;
    }
    .border-btn.btn-back:hover {
        background: #fff;
        color: var(--sai-n800);
        border-color: var(--sai-n200);
    }
}

.set-hero {
    position: relative;
    overflow: visible;
    background: #ffffff url("../images/sai/school-background.png") center bottom / cover no-repeat;
    padding: 20px 0 28px;
}
.set-hero:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.42) 48%, rgba(255,255,255,0.12) 100%);
}
.set-hero > .set-wrap { position: relative; z-index: 1; }
.hero-intro { padding-bottom: 12px; }
.hero-intro h1 {
    font-size: clamp(32px, 4.4vw, 52px);
    line-height: 1.12;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin: 0 0 10px;
    max-width: none;
    color: var(--sai-n800);
}
.lede {
    font-size: clamp(17px, 1.7vw, 24px);
    color: var(--sai-n600);
    font-weight: 500;
    max-width: none;
    margin: 0;
    line-height: 1.45;
}
.set-hero-split {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    gap: 16px 32px;
    align-items: stretch;
}
.hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    min-height: 0;
    height: 100%;
}
.hero-photo {
    position: relative;
    flex: 0 1 auto;
    min-height: 0;
    line-height: 0;
}
.hero-photo img {
    position: static;
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}
.hero-copy {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 2% 0 0;
    min-height: 0;
}
.hero-kicker {
    margin: 0;
    font-size: clamp(22px, 2.15vw, 32px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--sai-n800);
}
.hero-kicker em {
    font-style: normal;
    color: var(--sai-orange);
}
.hero-support {
    margin: 0;
    font-size: clamp(15px, 1.25vw, 18px);
    line-height: 1.55;
    font-weight: 400;
    color: var(--sai-n600);
    max-width: 32em;
}
.hero-brands {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 1.5vw, 24px);
    width: 100%;
    margin-top: 6px;
    padding-top: clamp(12px, 1.5vw, 20px);
    border-top: 1px solid rgba(30, 41, 59, 0.12);
}
.hero-brands a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.hero-brands a.brand-sirs {
    flex: 1.5 1 0;
}
.hero-brands img {
    height: clamp(64px, 6.8vw, 92px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.learning-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    margin-top: 8px;
}
.learn-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    min-height: 220px;
}
.learn-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.learn-card span {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 1;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
}
.learn-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(15,23,42,.55) 100%);
}

.set-form-card {
    background: #fff;
    border: 1px solid var(--sai-n200);
    border-radius: 20px;
    padding: 24px 24px 20px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    z-index: 2;
}
.set-form-card h2,
.set-form-card h2.form-title {
    margin: 0;
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.35em;
    line-height: 1.15;
    color: var(--sai-n800);
    white-space: nowrap;
}
.set-form-card h2 .form-kicker {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--sai-n500);
    white-space: nowrap;
}
.set-form-card h2 .form-highlight {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: var(--sai-n800);
    white-space: nowrap;
}
.set-form-card h2 em {
    font-style: normal;
    color: var(--sai-orange);
    font-weight: 700;
}
.exam-dates {
    margin: 14px 0 16px;
}
.exam-dates-label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sai-n500);
}
.exam-dates-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}
.exam-cal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--sai-n200);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.exam-cal-month {
    display: block;
    width: 100%;
    padding: 6px 8px 5px;
    background: var(--sai-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.exam-cal-day {
    display: block;
    padding: 6px 8px 0;
    font-size: clamp(36px, 5vw, 48px);
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--sai-n900);
}
.exam-cal-year {
    display: block;
    padding: 4px 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sai-n600);
}
.exam-dates-amp {
    font-size: 18px;
    font-weight: 600;
    color: var(--sai-n500);
}
#saveregisterform {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#section1, #section3 {
    flex: 0 0 auto;
    min-height: 0;
    align-content: start;
    grid-auto-rows: min-content;
}
.form-grid, .input-wrap-full {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}
.input-wrap, .input-wrap-full .input-wrap { min-width: 0; }
.input-wrap-full.span-2, .span-2, .form-actions, .alert { grid-column: 1 / -1; }
.form-label, label.form-label, h4.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sai-n700);
    margin: 0 0 6px;
}
h4.form-label { font-size: 11px; font-weight: 500; color: var(--sai-n500); margin-top: -4px; }
.sai-input, select.sai-input, input.sai-input {
    width: 100%;
    height: 50px;
    border: 1px solid #9aa3b2;
    border-radius: 10px;
    padding: 0 12px;
    background: #fff;
    color: var(--sai-n800);
    font-size: 16px;
    outline: none;
    font-family: inherit;
}
.sai-input:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--sai-orange);
}
.sai-input:disabled { background: var(--sai-n100); color: var(--sai-n700); }
.pin-row { display: flex; gap: 8px; }
.pin-row .sai-input { flex: 1; }
#search_button {
    height: 50px;
    background: var(--sai-n800);
    color: #fff;
    padding: 0 16px;
    white-space: nowrap;
}
#search_button:hover { background: #111827; color: #fff; border-color: transparent; }
.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    align-self: stretch;
    margin-top: 8px;
    padding-top: 8px;
}
.form-actions-submit .btn-back {
    margin-right: auto;
}
.border-btn { min-width: 110px; height: 44px; }
.border-btn.btn-back { background: #fff; color: var(--sai-n800); border: 1px solid var(--sai-n200); }
.border-btn.btn-back:hover { background: var(--sai-n100); color: var(--sai-n800); }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.set-syllabus { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; }
.set-syllabus span { font-size: 12px; color: var(--sai-n500); font-weight: 700; width: 100%; }
.set-syllabus a {
    text-decoration: none;
    background: var(--sai-orange-50);
    color: #c2410c;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.stats-section { background: var(--sai-n50); padding: 28px 0 12px; }
.section-kicker { color: var(--sai-n600); margin: 0 0 6px; font-size: 16px; }
.section-title { margin: 0 0 18px; font-size: clamp(28px, 4vw, 44px); font-weight: 500; letter-spacing: -0.03em; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.stat-card {
    display: flex;
    gap: 14px;
    align-items: center;
    border: 2px solid var(--sai-n200);
    border-radius: 22px;
    padding: 8px;
    background: #fff;
    min-height: 118px;
}
.stat-card img {
    width: 92px;
    height: 102px;
    object-fit: cover;
    border-radius: 14px;
    flex: 0 0 92px;
}
.stat-card strong { display: block; font-size: 28px; color: var(--sai-n700); }
.stat-card span { color: var(--sai-n600); font-size: 14px; }

.tour-section { padding: 20px 0 48px; }
.tour-card {
    position: relative;
    overflow: hidden;
    min-height: 380px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}
.tour-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tour-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}
.tour-copy { position: relative; z-index: 1; padding: 48px 24px; max-width: 720px; }
.tour-copy h3 { margin: 0 0 22px; font-size: clamp(28px, 4vw, 42px); font-weight: 500; }

.set-footer {
    background: transparent;
    color: var(--sai-n800);
    padding: 36px 0 calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(30, 41, 59, 0.1);
}
.set-footer a { color: var(--sai-n800); text-decoration: none; }
.set-footer a:hover { color: var(--sai-orange); }
.footer-brand { display: inline-flex; align-items: center; margin-bottom: 12px; }
.footer-brand img { height: 44px; width: auto; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px 32px; }
.set-footer h4 { margin: 0 0 8px; color: var(--sai-n800); font-weight: 600; font-size: 15px; }
.set-footer p, .set-footer li { color: var(--sai-n600); font-size: 14px; line-height: 1.6; }
.set-footer ul { margin: 0; padding-left: 18px; }
.copy {
    border-top: 1px solid rgba(30, 41, 59, 0.08);
    margin-top: 28px;
    padding-top: 14px;
    font-size: 12px;
    color: var(--sai-n500);
}

@media (max-width: 980px) {
    .set-wrap { width: min(1180px, calc(100% - 32px)); }
    .set-hero { padding: 14px 0 20px; }
    .hero-top { margin-bottom: 14px; gap: 10px; }
    .set-brand img { height: 40px; }
    .hero-top .btn { padding: 8px 14px; font-size: 14px; white-space: nowrap; }
    .hero-intro { padding-bottom: 12px; }
    .hero-intro h1 { font-size: clamp(26px, 7vw, 36px); }
    .lede { font-size: 16px; }
    .set-hero-split,
    .footer-grid,
    .stat-grid,
    .learning-grid { grid-template-columns: 1fr; }
    .hero-visual { min-height: 0; height: auto; order: 1; justify-content: flex-start; gap: 12px; }
    .hero-copy { flex: none; padding: 0; gap: 8px; }
    .hero-brands { margin-top: 8px; padding-top: 12px; gap: 12px; }
    .hero-brands img { height: 58px; }
    .set-form-card { order: 2; min-height: 0; padding: 18px 16px 16px; }
    .hero-kicker { font-size: 22px; }
    .hero-support { font-size: 15px; max-width: none; }
    .hero-photo { position: relative; min-height: 0; height: auto; flex: none; }
    .hero-photo img { position: static; height: auto; }
    #section1, #section3 { min-height: 0; }
    .set-form-card h2 .form-kicker { font-size: 12px; }
    .set-form-card h2 .form-highlight { font-size: 20px; }
    .exam-dates { margin: 12px 0 14px; }
    .exam-cal-day { font-size: 36px; }
    .form-actions { justify-content: flex-end; }
    .form-actions .border-btn { min-width: 110px; height: 48px; }
    .form-actions-submit { justify-content: space-between; }
    .form-actions-submit .btn-back { margin-right: 0; }
    .learn-card { min-height: 170px; }
    .tour-card { min-height: 240px; border-radius: 18px; }
    .tour-copy { padding: 28px 18px; }
    .tour-copy h3 { font-size: 26px; margin-bottom: 16px; }
    .stats-section { padding: 20px 0 8px; }
    .section-title { font-size: 28px; }
    .footer-grid { gap: 22px; }
    .set-footer { padding: 28px 0 calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
    .set-wrap { width: calc(100% - 24px); }
    .form-grid, .input-wrap-full { grid-template-columns: 1fr; }
    .pin-row { flex-wrap: wrap; }
    .pin-row .sai-input { min-width: 0; flex: 1 1 140px; }
    #search_button { flex: 1 1 auto; min-width: 96px; }
    .hero-brands { gap: 8px; }
    .hero-brands img { height: 46px; }
    .stat-card { min-height: 0; }
    .stat-card img { width: 72px; height: 80px; flex-basis: 72px; }
    .set-syllabus a { font-size: 11px; padding: 8px 10px; }
}

@media (max-width: 400px) {
    .set-wrap { width: calc(100% - 20px); }
    .hero-top .btn { padding: 8px 10px; font-size: 13px; }
    .set-brand img { height: 34px; }
    .hero-intro h1 { font-size: 24px; }
    .set-form-card { padding: 16px 12px 14px; border-radius: 16px; }
    .set-form-card h2 .form-kicker { font-size: 11px; }
    .set-form-card h2 .form-highlight { font-size: 18px; }
    .hero-brands img { height: 40px; }
    .sai-input, select.sai-input, input.sai-input, #search_button { height: 48px; }
}
