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

:root {
    /* Jawa Timur Government Color Palette */
    --jatim-navy: #0F2351;
    --jatim-blue: #1A3A7A;
    --jatim-red: #C0272D;
    --jatim-gold: #C8A020;
    --jatim-gold-lt: #E0B830;
    --white: #FFFFFF;
    --off-white: #F5F7FA;
    --text-dark: #1A202C;
    --text-mid: #4A5568;
    --text-muted: #718096;
    --border: #DDE3EE;
    --danger: #C0272D;
    --danger-bg: #FFF5F5;
    --danger-border: #FED7D7;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow-card: 0 20px 60px rgba(15, 35, 81, 0.22), 0 4px 16px rgba(15, 35, 81, 0.12);
    --shadow-btn: 0 4px 14px rgba(15, 35, 81, 0.35);
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    min-height: 100%;
    font-family: 'Inter', sans-serif;
}

/* ═══════════════════════════════════════
BACKGROUND — Jatim government aesthetic
═══════════════════════════════════════ */
body {
    background: var(--jatim-navy);
    background-image:
        /* Subtle diagonal lines — batik-inspired texture */
        repeating-linear-gradient(135deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.018) 40px,
            rgba(255, 255, 255, 0.018) 41px),
        repeating-linear-gradient(45deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.018) 40px,
            rgba(255, 255, 255, 0.018) 41px),
        /* Rich depth gradient */
        linear-gradient(160deg,
            #0a1a3d 0%,
            #0F2351 35%,
            #1A3A7A 65%,
            #0a1a3d 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow-x: hidden;
}

/* Decorative glowing orbs for depth */
body::before {
    content: '';
    position: fixed;
    top: -150px;
    left: -150px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(192, 39, 45, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 160, 32, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Horizontal accent bar on top */
.top-accent-bar {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg,
            var(--jatim-red) 0%,
            var(--jatim-gold) 50%,
            var(--jatim-red) 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
}

/* ═══════════════════════════════════════
PAGE WRAPPER
═══════════════════════════════════════ */
.page-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 40px;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════
GOVERNMENT HEADER BRANDING
═══════════════════════════════════════ */
.govt-header {
    text-align: center;
    margin-bottom: 28px;
    animation: fadeDown 0.6s ease both;
}

.govt-header .logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

a.logo-row:hover,
a.logo-row:focus {
    opacity: 0.85;
    transform: translateY(-2px);
    text-decoration: none;
    outline: none;
}

.govt-header .logo-row img {
    height: 62px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.govt-header .title-block {
    text-align: left;
}

.govt-header .inst-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--jatim-gold-lt);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.govt-header .app-name {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    letter-spacing: 0.3px;
}

.govt-header .app-name span {
    color: var(--jatim-gold-lt);
}

.govt-header .app-tagline {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    margin-top: 4px;
    letter-spacing: 0.2px;
}

/* Gold divider */
.gold-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    animation: fadeDown 0.7s ease both;
}

.gold-divider::before,
.gold-divider::after {
    content: '';
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--jatim-gold));
}

.gold-divider::after {
    background: linear-gradient(90deg, var(--jatim-gold), transparent);
}

.gold-divider .diamond {
    width: 7px;
    height: 7px;
    background: var(--jatim-gold);
    transform: rotate(45deg);
}

/* ═══════════════════════════════════════
LOGIN CARD
═══════════════════════════════════════ */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: fadeUp 0.7s ease both;
    position: relative;
}

/* Top stripe on card */
.card-stripe {
    height: 5px;
    background: linear-gradient(90deg,
            var(--jatim-navy) 0%,
            var(--jatim-red) 40%,
            var(--jatim-gold) 100%);
}

.card-body {
    padding: 34px 38px 30px;
}

/* Card header */
.card-header-section {
    text-align: center;
    margin-bottom: 26px;
}

.card-header-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--jatim-navy);
    margin-bottom: 4px;
}

.card-header-section p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Error alert */
.error-alert {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    color: var(--danger);
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.79rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
}

.input-wrap .ico {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-wrap input[type="text"],
.input-wrap input[type="password"] {
    width: 100%;
    padding: 11px 13px 11px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--off-white);
    transition: var(--transition);
    outline: none;
}

.input-wrap input:focus {
    border-color: var(--jatim-blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26, 58, 122, 0.12);
}

.input-wrap input:focus~.ico {
    color: var(--jatim-blue);
}

.input-wrap .btn-eye {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 6px;
    font-size: 0.88rem;
    transition: var(--transition);
    line-height: 1;
}

.input-wrap .btn-eye:hover {
    color: var(--jatim-blue);
}

/* Captcha */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.captcha-row .input-wrap {
    flex: 1;
}

.captcha-row .input-wrap input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: #FFFBEA;
    border-color: #E6D07A;
    transition: var(--transition);
    outline: none;
}

.captcha-row .input-wrap input:focus {
    border-color: var(--jatim-gold);
    box-shadow: 0 0 0 3px rgba(200, 160, 32, 0.15);
}

.captcha-img-box {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.captcha-img-box img {
    height: 42px;
    display: block;
}

/* Remember row */
.bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 20px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.83rem;
    color: var(--text-mid);
    cursor: pointer;
    user-select: none;
}

.check-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--jatim-blue);
    cursor: pointer;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--jatim-navy) 0%, var(--jatim-blue) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xs);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-btn);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #080f22 0%, var(--jatim-navy) 100%);
    box-shadow: 0 6px 20px rgba(15, 35, 81, 0.5);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

/* App store row */
.appstore-section {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    text-align: center;
}

.appstore-label {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appstore-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.appstore-links a {
    opacity: 0.8;
    transition: var(--transition);
}

.appstore-links a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.appstore-links img {
    height: 36px;
}

/* ═══════════════════════════════════════
QUICK ACCESS LINKS (below card)
═══════════════════════════════════════ */
.quick-links {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeUp 0.9s ease both;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    backdrop-filter: blur(6px);
}

.quick-link:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(200, 160, 32, 0.5);
    color: var(--jatim-gold-lt);
}

.quick-link .fa {
    font-size: 0.85rem;
    color: var(--jatim-gold);
}

/* ═══════════════════════════════════════
FOOTER
═══════════════════════════════════════ */
.page-footer {
    margin-top: 24px;
    text-align: center;
    animation: fadeUp 1s ease both;
    padding-bottom: 8px;
}

.page-footer .footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.page-footer .footer-logos img {
    height: 28px;
}

.page-footer .footer-text {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.8;
}

.page-footer .footer-text a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.page-footer .footer-text a:hover {
    color: var(--jatim-gold-lt);
}

/* Date badge top-right */
.date-badge {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    z-index: 100;
}

/* ═══════════════════════════════════════
ANIMATIONS
═══════════════════════════════════════ */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

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

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

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

/* ═══════════════════════════════════════
RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 500px) {
    .card-body {
        padding: 28px 22px 24px;
    }

    .govt-header .logo-row img {
        height: 50px;
    }

    .govt-header .app-name {
        font-size: 1.3rem;
    }

    .quick-links {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-link {
        justify-content: center;
    }
}