/* PinoyTeach auth pages — implements DESIGN.md */
:root {
    --ink: #14213D;
    --ink-soft: #4A5873;
    --muted: #8792A6;
    --brand: #1D4ED8;
    --brand-dark: #1639A8;
    --sun: #F5B335;
    --paper: #FBF8F2;
    --card: #FFFFFF;
    --line: #E4DFD3;
    --ok: #15803D;
    --ok-bg: #E7F6EC;
    --err: #B91C1C;
    --err-bg: #FDECEC;
    --r-input: 12px;
    --r-card: 20px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-optical-sizing: auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    font-weight: 500;
    text-decoration: none;
    transition: color .15s ease;
}

    a:hover {
        text-decoration: underline;
    }

svg {
    display: block;
}

/* ---------- layout ---------- */
.auth-wrap {
    display: grid;
    grid-template-columns: 45fr 55fr;
    min-height: 100vh;
}

/* ---------- art panel ---------- */
.auth-art {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    color: #fff;
    background: radial-gradient(circle at 85% 8%, rgba(245,179,53,.38), rgba(245,179,53,0) 42%), var(--ink);
}

    .auth-art::before,
    .auth-art::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        border: 1.5px solid rgba(255,255,255,.08);
        pointer-events: none;
    }

    .auth-art::before {
        width: 420px;
        height: 420px;
        right: -140px;
        bottom: -120px;
    }

    .auth-art::after {
        width: 260px;
        height: 260px;
        right: -60px;
        bottom: -40px;
    }

    .auth-art .brand {
        position: relative;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        gap: 12px;
        color: #fff;
        font-weight: 800;
        font-size: 1.25rem;
        letter-spacing: -0.01em;
    }

        .auth-art .brand:hover {
            text-decoration: none;
        }

    .auth-art .logo {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        background: var(--sun);
        color: var(--ink);
    }

        .auth-art .logo svg {
            width: 22px;
            height: 22px;
        }

.art-body {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

    .art-body h2 {
        font-weight: 800;
        font-size: 2.8rem;
        line-height: 1.05;
        letter-spacing: -0.02em;
        margin: 0 0 16px;
    }

        .art-body h2 em {
            font-style: normal;
            color: var(--sun);
        }

    .art-body p {
        margin: 0 0 28px;
        color: rgba(255,255,255,.78);
        font-size: 1rem;
    }

.art-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

    .art-points li {
        display: flex;
        align-items: center;
        gap: 12px;
        color: rgba(255,255,255,.92);
    }

        .art-points li span {
            flex: none;
            width: 24px;
            height: 24px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            background: var(--sun);
            color: var(--ink);
        }

            .art-points li span svg {
                width: 14px;
                height: 14px;
                stroke-width: 3;
            }

.art-foot {
    position: relative;
    z-index: 1;
    font-size: .82rem;
    color: rgba(255,255,255,.6);
}

/* ---------- form panel ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 40px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: 0 10px 40px rgba(20,33,61,.08);
    animation: rise .25s ease both;
}

.auth-wrap:has(.row-2) .auth-card {
    max-width: 520px;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.auth-card h1 {
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
    color: var(--ink);
}

.auth-card .sub {
    margin: 0 0 24px;
    color: var(--ink-soft);
}

    .auth-card .sub strong {
        color: var(--ink);
        word-break: break-all;
    }

/* ---------- alerts ---------- */
.alert {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 4px solid;
    font-size: .9rem;
}

    .alert.error {
        background: var(--err-bg);
        color: var(--err);
        border-color: var(--err);
    }

    .alert.success {
        background: var(--ok-bg);
        color: var(--ok);
        border-color: var(--ok);
    }

/* ---------- fields ---------- */
.field {
    margin-bottom: 16px;
}

    .field label {
        display: block;
        margin-bottom: 6px;
        font-size: .85rem;
        font-weight: 600;
        color: var(--ink-soft);
    }

        .field label small {
            color: var(--muted);
            font-weight: 400;
        }

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-wrap {
    position: relative;
}

    .input-wrap .ico {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        pointer-events: none;
        display: flex;
    }

        .input-wrap .ico svg {
            width: 18px;
            height: 18px;
        }

    .input-wrap input[type="text"],
    .input-wrap input[type="email"],
    .input-wrap input[type="password"],
    .input-wrap input[type="tel"],
    .input-wrap input {
        width: 100%;
        height: 48px;
        padding: 0 14px 0 44px;
        font: inherit;
        color: var(--ink);
        background: #fff;
        border: 1.5px solid var(--line);
        border-radius: var(--r-input);
        outline: none;
        transition: border-color .15s ease, box-shadow .15s ease;
    }

        .input-wrap input::placeholder {
            color: var(--muted);
        }

        .input-wrap input:hover {
            border-color: #cfc8b8;
        }

        .input-wrap input:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 4px rgba(29,78,216,.15);
        }

    .input-wrap.has-toggle input {
        padding-right: 70px;
    }

.toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    font: inherit;
    font-size: .82rem;
    font-weight: 500;
    color: var(--brand);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease;
}

    .toggle-pass:hover {
        background: rgba(29,78,216,.08);
    }

    .toggle-pass:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 1px;
    }

/* ---------- strength + hints ---------- */
.strength {
    margin-top: 10px;
}

    .strength .bar {
        height: 6px;
        background: var(--line);
        border-radius: 999px;
        overflow: hidden;
    }

        .strength .bar i {
            display: block;
            height: 100%;
            width: 0;
            border-radius: 999px;
            background: var(--err);
            transition: width .4s ease, background .2s ease;
        }

    .strength .txt, .hint {
        margin-top: 6px;
        font-size: .78rem;
        color: var(--muted);
    }

/* ---------- checkbox ---------- */
.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 20px;
}

    .check input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 3px 0 0;
        accent-color: var(--brand);
        flex: none;
    }

    .check label {
        font-size: .85rem;
        color: var(--ink-soft);
        cursor: pointer;
    }

/* ---------- button ---------- */
.btn-submit {
    width: 100%;
    height: 50px;
    font: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: var(--r-input);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

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

    .btn-submit:active {
        transform: none;
    }

    .btn-submit:focus-visible {
        outline: 3px solid rgba(29,78,216,.35);
        outline-offset: 2px;
    }

    .btn-submit:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
    }

.alt-link {
    margin: 20px 0 0;
    text-align: center;
    font-size: .9rem;
    color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .auth-wrap {
        grid-template-columns: 1fr;
    }

    .auth-art {
        display: none;
    }

    .auth-panel {
        padding: 24px 16px;
    }
}

@media (max-width: 560px) {
    .auth-card {
        padding: 24px 20px;
    }
    /* keep paired fields side by side on phones */
    .row-2 {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

        .row-2 .ico {
            display: none;
        }

        .row-2 .input-wrap input {
            padding-left: 12px;
            padding-right: 10px;
            font-size: .95rem;
        }

        .row-2 .field label {
            font-size: .8rem;
        }

            .row-2 .field label small {
                display: block;
                line-height: 1.2;
            }

    .auth-card h1 {
        font-size: 1.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
