/* =====================================================
           TOKENS
           Warna emerald (brand madrasah) + gold (aksen prestasi),
           dipilih karena PRESMA = sistem prestasi madrasah —
           hijau untuk identitas, emas untuk pencapaian/piagam.
        ====================================================== */
:root {
    --ink: #0d1b16;
    --muted: #5b6b64;
    --bg: #f5f7f6;
    --surface: #ffffff;
    --border: #e2e8e4;

    --brand: #15803d;
    --brand-dark: #166534;
    --brand-darker: #14532d;
    --brand-soft: #dcfce7;

    --gold: #c9971f;
    --gold-soft: #faf1dc;

    --danger: #dc3545;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;

    --field-h: 48px;
    --btn-h: 52px;

    --shadow-sm: 0 4px 14px rgba(21, 128, 61, 0.08);
    --shadow-md: 0 14px 34px rgba(22, 101, 52, 0.15);
    --shadow-lg: 0 24px 60px rgba(20, 83, 45, 0.3);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
}

h1,
h2,
h3,
.font-display {
    font-family: "Sora", sans-serif;
}

a {
    text-decoration: none;
}

.mono {
    font-family: "JetBrains Mono", monospace;
}

/* =====================================================
           LAYOUT
        ====================================================== */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* =========================
           ASIDE — signature panel:
           dashboard mockup dibuat
           murni dari HTML/CSS, tanpa
           gambar sama sekali
        ========================= */
.auth-aside {
    flex: 0 0 44%;
    max-width: 44%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 48px;
    color: #fff;
    background:
        radial-gradient(
            900px 500px at 15% -10%,
            rgba(255, 255, 255, 0.08),
            transparent 60%
        ),
        linear-gradient(
            165deg,
            var(--brand-darker),
            var(--brand-dark) 55%,
            var(--brand)
        );
    overflow: hidden;
}

.auth-aside::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    right: -100px;
    bottom: -120px;
}

.aside-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.aside-brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aside-brand .mark i {
    font-size: 18px;
    color: var(--gold);
}

.aside-brand span {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.aside-copy {
    position: relative;
    z-index: 2;
    max-width: 380px;
    margin-top: 36px;
}

.aside-copy .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gold-soft);
    background: rgba(201, 151, 31, 0.18);
    border: 1px solid rgba(201, 151, 31, 0.35);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.aside-copy h1 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
}

.aside-copy h1 em {
    font-style: normal;
    color: var(--gold);
}

.aside-copy p {
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

/* =========================
           DASHBOARD MOCKUP
           (signature element)
        ========================= */
.mock-stage {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.dash-card {
    width: 100%;
    max-width: 300px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    color: var(--ink);
    transform: rotate(-2deg);
    animation: floatY 6s ease-in-out infinite;
}

.dash-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dash-card__head .dots {
    display: flex;
    gap: 5px;
}

.dash-card__head .dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
}

.dash-card__head .dots span:first-child {
    background: #f59e0b;
}

.dash-card__head .dots span:nth-child(2) {
    background: #22c55e;
}

.dash-card__head strong {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}

.ring-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: conic-gradient(
        var(--brand) 0deg 295deg,
        var(--brand-soft) 295deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ring::before {
    content: "";
    position: absolute;
}

.ring span {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark);
}

.ring-wrap .ring-label {
    font-size: 12px;
    color: var(--muted);
}

.ring-wrap .ring-label strong {
    display: block;
    font-size: 13.5px;
    color: var(--ink);
    font-weight: 600;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.bar-row span:first-child {
    flex: 0 0 78px;
    color: var(--muted);
    font-weight: 500;
}

.bar-row .track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.bar-row .track i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand);
}

.bar-row .pct {
    flex: 0 0 32px;
    text-align: right;
    font-weight: 700;
    color: var(--ink);
}

.chip-float {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--ink);
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    font-size: 12px;
    font-weight: 600;
}

.chip-float i {
    color: var(--gold);
    font-size: 16px;
}

.chip-1 {
    top: 6%;
    right: 4%;
    transform: rotate(6deg);
    animation: floatY 5s ease-in-out infinite 0.3s;
}

.chip-2 {
    bottom: 10%;
    left: 2%;
    transform: rotate(-5deg);
    animation: floatY 5.5s ease-in-out infinite 0.8s;
}

.chip-2 i {
    color: var(--brand);
}

@keyframes floatY {
    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-10px) rotate(-1deg);
    }
}

.aside-foot {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 22px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
}

.aside-foot strong {
    color: #fff;
    font-family: "JetBrains Mono", monospace;
    font-size: 15px;
    display: block;
}

/* =====================================================
           MAIN FORM PANEL
        ====================================================== */
.auth-main {
    flex: 1;
    display: flex;
    justify-content: center;
    max-height: 100vh;
    overflow-y: auto;
    padding: 40px 32px;
}

.auth-card {
    width: 100%;
    max-width: 600px;
}

.auth-card .card-head {
    margin-bottom: 28px;
}

.card-head .step-tag {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.card-head h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-head p {
    color: var(--muted);
    font-size: 14px;
}

/* toast alert */
.toast-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 260px;
    max-width: 360px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    animation:
        toastIn 0.3s ease,
        toastOut 0.3s ease 4s forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-12px);
        visibility: hidden;
    }
}

/* form fields */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    display: block;
}

.form-control,
.form-select {
    height: var(--field-h);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    padding: 0 15px;
    font-size: 14.5px;
    background: var(--surface);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.form-control::placeholder {
    color: #9aa8a2;
}

.form-control:hover,
.form-select:hover {
    border-color: #cbd8d1;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.field-group {
    margin-bottom: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

/* section label above role */
.section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 10px;
    display: block;
}

/* role select — gaya "plan card" SaaS */
.role-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.role-card {
    cursor: pointer;
    user-select: none;
}

.role-radio {
    display: none;
}

.role-body {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--surface);
    transition:
        border-color 0.2s,
        background 0.2s,
        box-shadow 0.2s;
}

.role-body::after {
    content: "\ea4c";
    font-family: "boxicons";
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 16px;
    color: var(--border);
    transition: color 0.2s;
}

.role-card:hover .role-body {
    border-color: #b7ddc7;
    box-shadow: var(--shadow-sm);
}

.role-radio:checked + .role-body {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: var(--shadow-sm);
}

.role-radio:checked + .role-body::after {
    color: var(--brand);
}

.role-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    transition: background 0.2s;
}

.role-icon i {
    font-size: 20px;
    color: var(--brand);
}

.role-radio:checked + .role-body .role-icon {
    background: var(--brand);
}

.role-radio:checked + .role-body .role-icon i {
    color: #fff;
}

.role-body h5 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.role-body small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

#roleError {
    font-size: 13px;
    font-weight: 500;
}

.dynamic-form {
    animation: fadeUp 0.3s ease;
}

.role-fields {
    margin-bottom: 16px;
    animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* search select */
.search-select {
    position: relative;
}

.search-select .form-control {
    padding-right: 40px;
}

.search-select::after {
    content: "\ea4a";
    font-family: "boxicons";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition:
        transform 0.2s,
        color 0.2s;
}

.search-select:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
    color: var(--brand);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 20;
}

.dropdown-item-custom {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13.5px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    transition:
        background 0.15s,
        color 0.15s;
}

.dropdown-item-custom:last-child {
    border-bottom: none;
}

.dropdown-item-custom:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: #f8fafc;
}

/* password rules — hidden until typing */
.password-check {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.3s ease,
        opacity 0.25s ease,
        margin-top 0.3s ease;
}

.password-check.show {
    margin-top: 8px;
    max-height: 100px;
    opacity: 1;
}

.password-check small {
    font-size: 12.5px;
    transition: color 0.2s;
}

.password-check i {
    margin-right: 4px;
}

.invalid-rule {
    color: var(--danger);
}

.valid-rule {
    color: var(--brand-dark);
}

/* button */
.btn-register {
    width: 100%;
    height: var(--btn-h);
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        opacity 0.2s;
    margin-top: 6px;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-register:active {
    transform: scale(0.98);
}

.btn-register i {
    font-size: 18px;
}

.btn-register.loading {
    pointer-events: none;
    opacity: 0.75;
}

.btn-register.loading i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0);
    }

    to {
        transform: rotate(360deg);
    }
}

.footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13.5px;
    color: var(--muted);
}

.footer-link a {
    color: var(--brand);
    font-weight: 600;
}

.footer-link a:hover {
    text-decoration: underline;
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset;
    -webkit-text-fill-color: #111827;
}

/* =====================================================
           RESPONSIVE
        ====================================================== */
@media (max-width: 991px) {
    .auth-aside {
        display: none;
    }

    .auth-main {
        max-height: none;
        padding: 32px 20px;
    }
}

@media (max-width: 576px) {
    .auth-main {
        padding: 24px 16px;
    }

    .card-head h2 {
        font-size: 22px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .role-container {
        grid-template-columns: 1fr;
    }
}
