/**
 * Auth pages — PK Sapad Serbisyo Connect
 */

:root {
    --epi-950: #14532d;
    --epi-900: #166534;
    --epi-800: #15803d;
    --epi-700: #16a34a;
    --epi-600: #22c55e;
    --epi-500: #4ade80;
    --epi-400: #86efac;
    --epi-200: #bbf7d0;
    --epi-100: #dcfce7;
    --epi-50: #f0fdf4;
    --auth-text: #1f3d2e;
    --auth-muted: #5b7a6a;
    --auth-border: #dce8e0;
    --lp-font-heading: 'Arial Black', Arial, Helvetica, sans-serif;
    --lp-font-display: Arial, Helvetica, sans-serif;
    --lp-font-accent: Arial, Helvetica, sans-serif;
    --lp-font-script: Arial, Helvetica, sans-serif;
    --lp-font-body: Arial, Helvetica, sans-serif;
    --font-display: var(--lp-font-display);
    --font-accent: var(--lp-font-accent);
    --font-script: var(--lp-font-script);
    --font-body: var(--lp-font-body);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    height: 100%;
}

img,
video,
svg,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

body.auth-page {
    margin: 0;
    height: 100%;
    overflow: hidden;
    --bs-body-font-family: var(--lp-font-body);
    --bs-font-sans-serif: var(--lp-font-body);
    font-family: var(--lp-font-body);
    color: var(--auth-text);
    background: #f3f7f4;
}

.auth-page h1,
.auth-page h2,
.auth-page h3,
.auth-page .auth-brand strong,
.auth-page .auth-brand-sub,
.auth-page .auth-eyebrow,
.auth-page .auth-panel-title,
.auth-page .auth-feature-item > span:last-child,
.auth-page .auth-back,
.auth-page .auth-submit,
.auth-page .auth-main-eyebrow,
.auth-page label {
    font-family: var(--lp-font-display);
}

.auth-page .auth-panel-lead {
    font-family: var(--lp-font-accent);
}

.auth-page .auth-quote {
    font-family: var(--lp-font-script);
}

.auth-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

/* ── Left panel ── */
.auth-panel {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    color: var(--auth-text);
    background:
        radial-gradient(ellipse 50% 40% at 88% 12%, rgba(187, 247, 208, 0.55) 0%, transparent 70%),
        linear-gradient(165deg, #f7fcf8 0%, #eaf8ef 48%, #dff5e7 100%);
    padding: clamp(1rem, 2.2vh, 1.75rem) clamp(1.25rem, 3vw, 2.75rem);
    display: flex;
    align-items: stretch;
}

.auth-panel-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-leaf {
    position: absolute;
    background: rgba(34, 197, 94, 0.12);
    border-radius: 68% 32% 58% 42% / 42% 62% 38% 58%;
}

.auth-leaf-1 {
    width: 140px;
    height: 140px;
    top: 6%;
    right: 4%;
}

.auth-leaf-2 {
    width: 90px;
    height: 90px;
    left: 4%;
    top: 42%;
    background: rgba(22, 163, 74, 0.1);
}

.auth-dots {
    position: absolute;
    width: 72px;
    height: 72px;
    background-image: radial-gradient(circle, rgba(22, 163, 74, 0.28) 1.4px, transparent 1.6px);
    background-size: 12px 12px;
    opacity: 0.55;
}

.auth-dots-1 { top: 18%; left: 8%; }
.auth-dots-2 { right: 10%; bottom: 28%; }

.auth-wave {
    position: absolute;
    left: -8%;
    right: -8%;
    bottom: -10%;
    height: 26%;
    background: linear-gradient(165deg, #22c55e 0%, #16a34a 55%, #15803d 100%);
    border-radius: 55% 45% 0 0 / 100% 100% 0 0;
    opacity: 0.95;
}

.auth-panel-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(0.75rem, 2vh, 1.5rem);
    width: 100%;
    max-width: 560px;
    height: 100%;
    min-height: 0;
    padding-bottom: 0.35rem;
}

.auth-panel-top {
    position: relative;
    z-index: 2;
    min-height: 0;
}

.auth-panel-foot {
    position: relative;
    z-index: 2;
    padding-top: clamp(0.5rem, 1.5vh, 1.25rem);
    margin-top: auto;
}

.auth-brand {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: clamp(0.75rem, 2vh, 1.25rem);
}

.auth-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.auth-brand strong {
    font-family: var(--lp-font-display);
    font-size: clamp(1.35rem, 2.2vh, 1.55rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--epi-800);
    line-height: 1.05;
}

.auth-brand-sub {
    font-family: var(--lp-font-display);
    font-size: clamp(1.2rem, 2vh, 1.38rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--epi-900);
    line-height: 1.05;
}

.auth-brand-meta {
    margin-top: 0.28rem;
    font-family: var(--lp-font-body);
    font-size: clamp(0.82rem, 1.5vh, 0.92rem);
    color: var(--auth-muted);
    font-weight: 500;
}

.auth-eyebrow {
    margin: 0 0 0.65rem;
    font-family: var(--lp-font-display);
    font-size: clamp(0.78rem, 1.5vh, 0.88rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--epi-700);
}

.auth-panel-title {
    margin: 0 0 0.7rem;
    font-family: var(--lp-font-heading);
    font-size: clamp(2rem, 4vh, 2.85rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: #1a2e22;
}

.auth-panel-title-lead,
.auth-panel-title-accent {
    display: block;
}

.auth-panel-title-accent {
    color: var(--epi-600);
}

.auth-panel-lead {
    margin: 0 0 clamp(0.85rem, 2vh, 1.25rem);
    max-width: 34rem;
    font-family: var(--lp-font-accent);
    font-size: clamp(1.05rem, 2.1vh, 1.18rem);
    font-weight: 700;
    font-style: normal;
    line-height: 1.55;
    color: #3d5246;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

@media (min-width: 700px) {
    .auth-feature-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.auth-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding: clamp(0.55rem, 1.4vh, 0.8rem) 0.45rem;
    background: rgba(220, 252, 231, 0.85);
    border-radius: 0.9rem;
    border: 1px solid rgba(22, 163, 74, 0.1);
}

.auth-feature-icon {
    color: var(--epi-700);
    font-size: 1.3rem;
}

.auth-feature-item > span:last-child {
    font-family: var(--lp-font-display);
    font-size: clamp(0.8rem, 1.5vh, 0.9rem);
    font-weight: 700;
    color: var(--epi-900);
    line-height: 1.25;
}

.auth-quote {
    margin: 0;
    font-family: var(--lp-font-script);
    font-size: clamp(1.5rem, 3vh, 2.05rem);
    font-weight: 700;
    color: var(--epi-800);
    line-height: 1.15;
    text-decoration: underline;
    text-decoration-color: rgba(34, 197, 94, 0.45);
    text-underline-offset: 0.28em;
}

/* ── Right panel ── */
.auth-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: clamp(1rem, 2.5vh, 1.75rem) 1.25rem;
    background:
        radial-gradient(ellipse 45% 35% at 85% 15%, rgba(220, 252, 231, 0.55) 0%, transparent 70%),
        #f5f8f6;
}

.auth-main-eyebrow {
    position: absolute;
    top: 1rem;
    right: 1.35rem;
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--epi-700);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    max-height: calc(100% - 0.5rem);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(22, 163, 74, 0.1);
    border-radius: 1.25rem;
    padding: clamp(1rem, 2.2vh, 1.45rem) clamp(1rem, 2vw, 1.35rem);
    box-shadow: 0 18px 40px rgba(22, 101, 52, 0.1);
}

.auth-card-head {
    margin-bottom: 0.85rem;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
    color: var(--epi-700);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-back:hover {
    color: var(--epi-600);
}

.auth-card-head h2 {
    margin: 0 0 0.3rem;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.4vh, 1.7rem);
    font-weight: 800;
    color: var(--epi-900);
    letter-spacing: -0.02em;
}

.auth-card-head p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--auth-muted);
    line-height: 1.4;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.86rem;
    line-height: 1.4;
}

.auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: var(--epi-50);
    color: var(--epi-900);
    border: 1px solid var(--epi-200);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--epi-800);
}

.auth-input {
    position: relative;
}

.auth-input > i:first-child {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--epi-600);
    font-size: 0.9rem;
    pointer-events: none;
}

.auth-input input {
    width: 100%;
    border: 1px solid rgba(22, 163, 74, 0.18);
    border-radius: 0.85rem;
    background: #f8fbf9;
    padding: 0.7rem 2.6rem 0.7rem 2.4rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--auth-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input input:focus {
    border-color: var(--epi-600);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.auth-eye {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.auth-eye:hover {
    color: var(--epi-700);
    background: rgba(34, 197, 94, 0.08);
}

.auth-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--epi-600);
}

.auth-forgot {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--epi-700);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.auth-forgot:hover {
    color: var(--epi-600);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    border: 0;
    border-radius: 0.85rem;
    background: linear-gradient(165deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.75rem 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.26);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
    filter: brightness(1.03);
    box-shadow: 0 14px 28px rgba(22, 163, 74, 0.32);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-or {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0.85rem 0 0.7rem;
    color: var(--auth-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-or::before,
.auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(22, 163, 74, 0.16);
}

.auth-secure-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.85rem;
    background: var(--epi-50);
    border: 1px solid rgba(22, 163, 74, 0.12);
}

.auth-secure-note i {
    color: var(--epi-600);
    margin-top: 0.1rem;
}

.auth-secure-note p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--auth-muted);
}

@media (max-width: 991.98px) {
    body.auth-page {
        overflow: auto;
    }

    .auth-shell {
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow: visible;
        grid-template-columns: 1fr;
    }

    .auth-panel {
        min-height: auto;
        height: auto;
        padding-bottom: 2rem;
    }

    .auth-panel-inner {
        height: auto;
        max-width: none;
    }

    .auth-wave {
        height: 22%;
    }

    .auth-main {
        height: auto;
        padding-top: 1.5rem;
        padding-bottom: 2rem;
        overflow: visible;
    }

    .auth-main-eyebrow {
        position: static;
        text-align: center;
        margin-bottom: 0.85rem;
    }

    .auth-card {
        max-height: none;
    }
}

@media (max-width: 575.98px) {
    .auth-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-card {
        padding: 1.35rem 1.15rem 1.2rem;
        border-radius: 1.25rem;
    }
}

/* ===== Login welcome modal ===== */
body:has(.login-modal) {
    overflow: hidden;
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: loginFadeIn 0.2s ease;
}

.login-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    padding: 1.75rem 1.5rem 1.35rem;
    border-radius: 20px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, #22c55e, #16a34a 45%, #0ea5e9) border-box;
    border: 1.5px solid transparent;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.22);
    text-align: center;
    animation: loginPopIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-modal-icon {
    width: 3.6rem;
    height: 3.6rem;
    margin: 0 auto 0.95rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(145deg, #ecfdf5, #dcfce7);
    color: #16a34a;
    font-size: 1.45rem;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.18);
}

.login-modal-kicker {
    margin: 0 0 0.35rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #22c55e;
}

.login-modal-dialog h3 {
    margin: 0 0 0.55rem;
    font-family: var(--font-body);
    font-size: clamp(1.2rem, 2.5vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #1c2b39;
    line-height: 1.3;
}

.login-modal-copy {
    margin: 0 auto 1.25rem;
    max-width: 21rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.55;
    color: #64748b;
}

.login-modal-actions {
    display: grid;
}

.login-modal-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: linear-gradient(165deg, #22c55e, #16a34a);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-modal-confirm:hover {
    color: #fff;
    background: linear-gradient(165deg, #16a34a, #15803d);
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.34);
}

.login-modal-confirm:active {
    transform: translateY(1px);
}

.login-modal-hint {
    margin: 0.85rem 0 0;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
}

@keyframes loginFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes loginPopIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
