/*
 * irph-tetamu.css — kesan pertama "Canggih": Log masuk, Daftar, lupa kata laluan,
 * laman utama (/) dan halaman ralat (RD 29 Sep 2026).
 * Semua warna drp token irph-tema.css. Satu kad hero sahaja setiap halaman (panel jenama).
 * Token tempatan (bukan dikongsi): --tt-aksen = biru jenama utk jalur nota/langkah
 * (#1f4fc4 terang / #7fb0ff gelap — sama seperti .btn-primary, BUKAN biru legend #0d6efd).
 */
:root,
[data-bs-theme="light"] { --tt-aksen: #1f4fc4; --tt-hero-label: #b9f5ea; }
[data-bs-theme="dark"] { --tt-aksen: #7fb0ff; --tt-hero-label: #c9fbf1; }

.tt-badan { margin: 0; background: var(--it-bg); color: var(--it-text); }

/* ---------- Rangka: telefon = hero padat di atas, kad borang di bawah ---------- */
.tt {
    box-sizing: border-box;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 12px 20px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--it-text);
}
.tt *, .tt *::before, .tt *::after { box-sizing: border-box; }

/* ---------- Kad hero (panel jenama) ---------- */
.tt-hero {
    border-radius: 18px;
    padding: 14px 16px 16px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .07) 0 70px, transparent 71px),
        radial-gradient(circle at 100% 0%, transparent 0 118px, rgba(255, 255, 255, .08) 119px 120px, transparent 121px),
        var(--it-hero);
    box-shadow: var(--it-hero-shadow);
    overflow: hidden;
}
.tt-hero-isi { display: flex; flex-direction: column; }
.tt-cip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 5px 16px 5px 8px;
    border-radius: 99px;
    background: var(--it-surface);
    border: 1px solid color-mix(in srgb, var(--it-border), transparent 40%);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(10, 19, 48, .18);
}
.tt-cip img { width: 30px; height: 30px; display: block; }
.tt-jenama {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .5px;
    line-height: 1;
    background: var(--it-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tt-hero-label {
    margin-top: 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tt-hero-label);
}
.tt-slogan { margin: 4px 0 4px; font-size: 20px; font-weight: 800; line-height: 1.25; color: #fff; }
.tt-sub { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .9); }
.tt-titik { display: none; list-style: none; margin: 0; padding: 0; }
.tt-titik li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .94); }
.tt-titik i {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .14);
    color: var(--tt-hero-label);
}

/* ---------- Kad borang ---------- */
.tt-kad {
    background: var(--it-surface);
    border: 1px solid var(--it-border);
    border-radius: 18px;
    padding: 20px 16px;
    color: var(--it-text);
}
.tt-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--it-muted); }
.tt-tajuk { margin: 2px 0 6px; font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--it-text); }
.tt-lead { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--it-muted); }
.tt-seksyen {
    margin: 22px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--it-border);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--it-muted);
}
.tt-seksyen.pertama { margin-top: 4px; padding-top: 0; border-top: 0; }

.tt-kad .form-label { margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--it-text); }
.tt-kad .form-text { font-size: 12.5px; line-height: 1.45; color: var(--it-muted); }
/* Ralat pengesahan (x-input-error, pratonton telefon, carian sekolah): merah Bootstrap #dc3545 hanya
   3.7:1 (terang) / 3.0:1 (gelap) pada kad token — dinaikkan ke >= 4.5:1. Merah bahaya/ralat, bukan merah Draf. */
.tt-kad .text-danger { color: #b02a37 !important; }
[data-bs-theme="dark"] .tt-kad .text-danger { color: #ea868f !important; }
.tt-kad .form-control, .tt-kad .form-select { min-height: 48px; font-size: 16px; }
.tt-kad .form-control::placeholder { color: color-mix(in srgb, var(--it-muted), transparent 25%); }
.tt-kad .form-control:focus, .tt-kad .form-select:focus {
    border-color: var(--tt-aksen);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tt-aksen) 22%, transparent);
    background-color: color-mix(in srgb, var(--it-surface), #ffffff 35%);
    color: var(--it-text);
}
[data-bs-theme="dark"] .tt-kad .form-control:focus, [data-bs-theme="dark"] .tt-kad .form-select:focus { background-color: var(--it-surface-2); }
.tt-kad .form-control:disabled, .tt-kad .form-select:disabled {
    background-color: var(--it-surface-2);
    color: var(--it-muted);
    opacity: 1;
}
.tt-medan { margin-bottom: 16px; }

/* Kata laluan + butang mata (sasaran 48px) */
.tt-kata { position: relative; }
.tt-kata .form-control { padding-right: 52px; }
.tt-mata {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: var(--it-muted);
    cursor: pointer;
}
.tt-mata:hover { color: var(--it-text); }
.tt-mata:focus-visible { outline: 3px solid color-mix(in srgb, var(--tt-aksen) 45%, transparent); outline-offset: -3px; }

.tt-baris { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tt-semak { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; font-size: 14px; }
.tt-semak .form-check-input { margin: 0; flex: none; }
.tt-pautan { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; text-decoration: none; }
.tt-pautan:hover { text-decoration: underline; }

.tt-utama.btn { width: 100%; min-height: 50px; border-radius: 12px; font-size: 16px; font-weight: 800; }
.tt-kedua.btn {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    background: var(--it-surface-2);
    color: var(--it-text);
    border: 1px solid var(--it-border);
}
.tt-kedua.btn:hover { background: color-mix(in srgb, var(--it-surface-2), var(--it-text) 7%); color: var(--it-text); border-color: var(--it-border); }

.tt-kaki {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--it-border);
    text-align: center;
    font-size: 14px;
    color: var(--it-muted);
}
.tt-kaki .tt-pautan { margin-left: 4px; }

/* Nota / status (jalur biru jenama — bukan hijau Siap) */
.tt-nota {
    margin-bottom: 16px;
    padding: 12px 14px 12px 16px;
    border-radius: 12px;
    background: var(--it-surface-2);
    border: 1px solid var(--it-border);
    box-shadow: inset 4px 0 0 var(--tt-aksen);
    font-size: 14px;
    line-height: 1.5;
    color: var(--it-text);
}
.tt-nota b { display: block; margin-bottom: 2px; }
.tt-nota-emel { margin-top: 6px; font-weight: 800; overflow-wrap: anywhere; }

/* Daftar: hasil carian sekolah (skrol DALAM kad) + sekolah dipilih */
.tt-kad #schoolResults:not(:empty) { border: 1px solid var(--it-border); border-radius: 12px; }
.tt-kad #schoolResults .list-group-item { flex-shrink: 0; min-height: 48px; border-left: 0; border-right: 0; font-size: 14px; }
.tt-kad #schoolResults .list-group-item:first-child { border-top: 0; }
.tt-kad #schoolResults .list-group-item:last-child { border-bottom: 0; }
.tt-kad #schoolResults .list-group-item-action:hover,
.tt-kad #schoolResults .list-group-item-action:focus { background: var(--it-surface-2); color: var(--it-text); }
.tt-dipilih {
    margin-top: 8px;
    padding: 10px 10px 10px 16px;
    border-radius: 12px;
    background: var(--it-surface-2);
    border: 1px solid var(--it-border);
    box-shadow: inset 4px 0 0 var(--tt-aksen);
}
.tt-dipilih .btn { flex: none; }

.tt-hak { text-align: center; font-size: 12px; color: var(--it-muted); padding: 4px 0 0; }

/* ---------- Desktop: panel jenama kiri, borang kanan ---------- */
@media (min-width: 900px) {
    .tt {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
        align-items: stretch;
        align-content: center;
        gap: 24px;
        padding: 32px 24px 20px;
    }
    .tt-hero { padding: 36px 36px 40px; min-height: 540px; border-radius: 22px;
        background:
            radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .06) 0 150px, transparent 151px),
            radial-gradient(circle at 100% 0%, transparent 0 230px, rgba(255, 255, 255, .07) 231px 232px, transparent 233px),
            radial-gradient(circle at 0% 100%, rgba(255, 255, 255, .04) 0 120px, transparent 121px),
            var(--it-hero); }
    .tt-hero-isi { position: sticky; top: 32px; }
    .tt-cip { padding: 6px 18px 6px 10px; }
    .tt-cip img { width: 34px; height: 34px; }
    .tt-jenama { font-size: 26px; }
    .tt-hero-label { margin-top: 64px; }
    .tt-slogan { font-size: 34px; line-height: 1.15; max-width: 16ch; margin-top: 8px; }
    .tt-sub { font-size: 16px; max-width: 42ch; margin-top: 8px; }
    .tt-titik { display: flex; flex-direction: column; gap: 14px; margin-top: 30px; }
    .tt-kad { align-self: center; padding: 32px 30px; border-radius: 22px; }
    .tt-hak { grid-column: 1 / -1; }
}

/* ================================================================
 * Laman utama (/) — .tw
 * ================================================================ */
.tw-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--it-bar);
    border-bottom: 1px solid var(--it-border);
    backdrop-filter: saturate(1.2) blur(8px);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
}
.tw-bar-isi { max-width: 1080px; margin: 0 auto; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tw-bar .tt-cip { box-shadow: none; }
.tw-bar-kanan { display: flex; gap: 8px; }
.tw { box-sizing: border-box; max-width: 1080px; margin: 0 auto; padding: 14px 12px 24px; display: flex; flex-direction: column; gap: 14px; color: var(--it-text); }
.tw *, .tw *::before, .tw *::after { box-sizing: border-box; }
.tw .tt-hero { padding: 22px 18px 20px; min-height: 0; }
.tw-hero-isi { min-width: 0; }
.tw-hias { display: none; }
.tw-h1 { margin: 6px 0 8px; font-size: 26px; font-weight: 800; line-height: 1.2; color: #fff; }
.tw-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tw-cta a {
    min-height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}
.tw-cta-utama { background: rgba(255, 255, 255, .95); color: #1d2f7a; }
.tw-cta-utama:hover { background: #fff; color: #15245f; }
.tw-cta-kedua { border: 1.5px solid rgba(255, 255, 255, .6); color: #fff; }
.tw-cta-kedua:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.tw-langkau { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 10px 0 0; font-size: 13px; color: rgba(255, 255, 255, .9); cursor: pointer; }
.tw-langkau .form-check-input { margin: 0; flex: none; border-color: rgba(255, 255, 255, .7); background-color: rgba(255, 255, 255, .15); }
.tw-langkau .form-check-input:checked { background-color: #fff; border-color: #fff; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231d2f7a' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.tw-langkau .form-check-input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }

.tw-kepala { margin: 10px 0 0; }
.tw-kepala h2 { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.tw-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tw-kad {
    background: var(--it-surface);
    border: 1px solid var(--it-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.tw-ikon {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--tt-aksen) 14%, var(--it-surface));
    color: var(--tt-aksen);
}
.tw-kad h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; line-height: 1.3; }
.tw-kad p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--it-muted); }
.tw-no {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--tt-aksen);
    border: 2px solid var(--tt-aksen);
}
.tw-kaki { border-top: 1px solid var(--it-border); padding: 18px 12px; text-align: center; font-size: 13px; color: var(--it-muted); }

@media (min-width: 768px) {
    .tw { padding: 24px 24px 32px; gap: 18px; }
    .tw .tt-hero { padding: 44px 44px 40px; border-radius: 22px;
        background:
            radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .06) 0 170px, transparent 171px),
            radial-gradient(circle at 100% 0%, transparent 0 260px, rgba(255, 255, 255, .07) 261px 262px, transparent 263px),
            var(--it-hero); }
    .tw-h1 { font-size: 40px; max-width: 18ch; line-height: 1.12; }
    .tw .tt-hero { min-height: 0; }
    .tw .tt-sub { font-size: 17px; max-width: 56ch; }
    .tw-cta { flex-direction: row; }
    .tw-cta a { padding: 0 26px; }
    .tw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .tw-kad { flex-direction: column; padding: 20px; }
    .tw-bar-isi { padding: 10px 24px; }
}

/* ================================================================
 * Halaman ralat (404/500/…) — .te; tanpa Bootstrap, token sahaja.
 * ================================================================ */
.te-badan {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--it-bg);
    color: var(--it-text);
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
    -webkit-text-size-adjust: 100%;
}
.te-badan *, .te-badan *::before, .te-badan *::after { box-sizing: border-box; }
.te { width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.te .tt-cip { align-self: center; box-shadow: none; }
.te-kad {
    width: 100%;
    background: var(--it-surface);
    border: 1px solid var(--it-border);
    border-radius: 18px;
    padding: 24px 18px 20px;
    text-align: center;
}
.te-kod {
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 2px;
    background: var(--it-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: .85;
}
.te-kad h1 { margin: 12px 0 8px; font-size: 20px; font-weight: 800; line-height: 1.3; }
.te-kad p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--it-muted); }
.te-aksi { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.te-btn {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--it-border);
    background: var(--it-surface-2);
    color: var(--it-text);
}
.te-btn:hover { background: color-mix(in srgb, var(--it-surface-2), var(--it-text) 7%); }
.te-btn.utama { background: #1f4fc4; border-color: #1f4fc4; color: #fff; font-weight: 800; }
.te-btn.utama:hover { background: #183e9c; border-color: #183e9c; }
[data-bs-theme="dark"] .te-btn.utama { background: #7fb0ff; border-color: #7fb0ff; color: #0b1532; }
[data-bs-theme="dark"] .te-btn.utama:hover { background: #a3c6ff; border-color: #a3c6ff; }
.te-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--tt-aksen) 45%, transparent); outline-offset: 2px; }
.te-kecil { font-size: 12px; color: var(--it-muted); text-align: center; }
@media (min-width: 480px) {
    .te-kad { padding: 32px 28px 26px; }
    .te-aksi { flex-direction: row-reverse; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .tt *, .tw *, .te * { transition: none !important; animation: none !important; }
}

/* Medan dilumpuhkan (Daftar: jenis/nama sekolah sebelum negeri dipilih) — garis putus supaya jelas. */
.tt-kad .form-control:disabled, .tt-kad .form-select:disabled { border-style: dashed; cursor: not-allowed; }

/* Laman utama desktop: hiasan jadual minggu (putih lut sinar sahaja; tiada data, tiada warna makna). */
@media (min-width: 900px) {
    .tw .tt-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; }
    .tw-hias { display: block; }
    .tw-hias-kad {
        border-radius: 18px;
        padding: 18px;
        background: rgba(255, 255, 255, .09);
        border: 1px solid rgba(255, 255, 255, .18);
        box-shadow: 0 18px 40px rgba(5, 12, 40, .25);
        transform: rotate(-2deg);
    }
    .tw-hias-atas { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
    .tw-hias-atas i { display: block; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .55); }
    .tw-hias-baris { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 8px; }
    .tw-hias-baris b { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--tt-hero-label); }
    .tw-hias-sel { display: flex; gap: 6px; }
    .tw-hias-sel i { height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .14); box-shadow: inset 3px 0 0 rgba(255, 255, 255, .5); }
    .tw-hias-sel i.k { background: rgba(255, 255, 255, .06); box-shadow: none; }
}
