/* =============================================================
   RDN2k24 — Login / Authentication Page
   Shared across all apps via sharedAssets.
   ============================================================= */

/* ── FONT — Inter (per kurikulum.kemendikdasmen.go.id --fnt-main).
   @import must precede all other rules in CSS, so it lives here. ── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ── TOKENS — kurikulum.kemendikdasmen.go.id palette ─────────── */
/* #305E8F primary · #06295A footer · #157ED4 secondary · #419FED tertiary
   #0192D5 cyan accent · #F87316 brand orange · #FFAD33 emphasis
   #97D8E9 link hover · #DDF0FF sky bg */
:root {
    --login-blue-1:    #305E8F;  /* steel blue (primary CTA) */
    --login-blue-2:    #1E3C5B;  /* heading navy */
    --login-blue-3:    #06295A;  /* footer deep navy */
    --login-blue-mid:  #157ED4;  /* secondary brand blue */
    --login-blue-link: #419FED;  /* tertiary / link */
    --login-accent:    #0192D5;  /* cyan accent */
    --login-orange:    #F87316;  /* signature orange */
    --login-emphasis:  #FFAD33;  /* amber emphasis */
    --login-sky:       #DDF0FF;  /* hero pastel */
    --login-glass-bg:  rgba(255, 255, 255, 0.10);
    --login-glass-bdr: rgba(255, 255, 255, 0.22);
    --login-box-bg:    #ffffff;
    --login-input-bg:  #F5FAFF;
    --login-input-bdr: #D4DCE2;
    --login-text:      #1E3C5B;
    --login-muted:     #6A7075;
    --login-radius:    12px;
    --login-radius-xl: 24px;
    --login-shadow:    0 20px 60px rgba(6, 41, 90, 0.34), 0 4px 16px rgba(6, 41, 90, 0.20);
    --login-transition: 0.22s ease;
}

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

/* ── PAGE ────────────────────────────────────────────────────── */
html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body {
    font-family: 'Inter', Helvetica, Arial, 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Deep kurikulum-navy backdrop with cyan + orange glow */
    background:
        radial-gradient(ellipse 70% 55% at 12% 85%, rgba(1, 146, 213, .35) 0%, transparent 65%),
        radial-gradient(ellipse 65% 45% at 88% 12%, rgba(248, 115, 22, .22) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(151, 216, 233, .12) 0%, transparent 70%),
        linear-gradient(145deg, #04132F 0%, #06295A 45%, #1E3C5B 100%);
    animation: bgShift 14s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0%   { background-position: 0% 0%;   }
    100% { background-position: 100% 100%; }
}

/* ── DECORATIVE BLOBS ────────────────────────────────────────── */
.rdn-deco {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}
.rdn-deco img {
    width: 45vw;
    max-width: 580px;
    opacity: 0.28;
    filter: blur(1px) brightness(1.1);
}
.rdn-deco--tr { top: -2%; right: -2%; }
.rdn-deco--bl { bottom: -2%; left: -2%; }

/* Floating animated orbs */
body::before, body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(255,255,255,.22) 0%, transparent 70%);
    top: -140px; right: -100px;
    animation: orbFloat 10s ease-in-out infinite alternate;
}
body::after {
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(255,255,255,.16) 0%, transparent 70%);
    bottom: -100px; left: -80px;
    animation: orbFloat 12s ease-in-out infinite alternate-reverse;
}
@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, 20px) scale(1.06); }
}

/* ── MAIN CONTAINER ──────────────────────────────────────────── */
.login-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    padding: 16px;
    overflow: hidden;
}

/* ── GRADIENT CARD ───────────────────────────────────────────── */
.login-card {
    position: relative;
    background:
        linear-gradient(135deg,
            #06295A 0%,
            #0E3C72 22%,
            #1F5BA0 48%,
            #2E7CC8 72%,
            #419FED 100%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--login-radius-xl);
    box-shadow:
        0 28px 72px rgba(6, 41, 90, .52),
        0 10px 28px rgba(6, 41, 90, .32),
        inset 0 1px 0 rgba(255, 255, 255, .22),
        inset 0 -1px 0 rgba(0, 0, 0, .15);
    padding: 24px 28px;
    width: 100%;
    max-width: 1060px;
    max-height: calc(100vh - 32px);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    isolation: isolate;
    animation: cardIn .52s cubic-bezier(.22,.68,0,1.2) both;
}
/* Soft colored highlights for depth — pale cyan + brand orange glow */
.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(151, 216, 233, .32) 0%, transparent 45%),
        radial-gradient(circle at 92% 100%, rgba(248, 115, 22, .26) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(1, 146, 213, .22) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}
/* Subtle moving sheen for premium feel */
.login-card::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(115deg,
        transparent 35%,
        rgba(255, 255, 255, .08) 50%,
        transparent 65%);
    pointer-events: none;
    z-index: -1;
    animation: sheenSlide 11s ease-in-out infinite;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(28px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
@keyframes sheenSlide {
    0%, 100% { transform: translateX(-25%); }
    50%      { transform: translateX(25%); }
}

/* ── LEFT PANEL ──────────────────────────────────────────────── */
.login-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-right: 24px;
    min-height: 0;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.login-brand-logo {
    height: 68px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.18));
}
.login-brand-divider {
    width: 1px;
    height: 48px;
    background: rgba(255,255,255,.38);
    flex-shrink: 0;
}
.login-brand-text {}
.login-brand-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    color: #fff;
    max-width: 280px;
}
.login-brand-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.78rem;
    color: rgba(255,255,255,.62);
    margin-top: 2px;
}

.login-illustration {
    width: 100%;
    max-width: 360px;
    max-height: 42vh;
    height: auto;
    object-fit: contain;
    margin-top: 12px;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.22));
    animation: illustFloat 6s ease-in-out infinite alternate;
}
@keyframes illustFloat {
    from { transform: translateY(0); }
    to   { transform: translateY(-10px); }
}

/* ── RIGHT PANEL — FORM BOX ──────────────────────────────────── */
.login-box {
    background: var(--login-box-bg);
    border-radius: var(--login-radius-xl);
    padding: 32px 32px;
    width: 100%;
    max-height: 100%;
    box-shadow: 0 8px 32px rgba(30, 27, 75, .14);
    position: relative;
    overflow-y: auto;
}
/* Subtle top accent line */
.login-box::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--login-blue-3) 0%, var(--login-blue-mid) 35%, var(--login-accent) 70%, var(--login-orange) 100%);
    border-radius: var(--login-radius-xl) var(--login-radius-xl) 0 0;
}

.login-box-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.55rem;
    color: var(--login-text);
    line-height: 1.2;
    margin-bottom: 4px;
}
.login-box-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--login-muted);
    margin-bottom: 28px;
}

/* ── FORM CONTROLS ───────────────────────────────────────────── */
.rdn-field-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--login-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}

.rdn-input-group {
    display: flex;
    align-items: stretch;
    background: var(--login-input-bg);
    border: 1.5px solid var(--login-input-bdr);
    border-radius: var(--login-radius);
    transition: border-color var(--login-transition), box-shadow var(--login-transition);
    overflow: hidden;
    margin-bottom: 18px;
}
.rdn-input-group:focus-within {
    border-color: var(--login-blue-mid);
    box-shadow: 0 0 0 4px rgba(65, 159, 237, .33);  /* matches kurikulum --clr-inputoutline */
}

.rdn-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: var(--login-blue-1);
    font-size: 1rem;
    background: transparent;
    flex-shrink: 0;
}

.rdn-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--login-text);
    padding: 12px 14px 12px 0;
    outline: none;
}
.rdn-input::placeholder { color: #b0bac8; }

.rdn-input-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--login-muted);
    font-size: 1rem;
    transition: color var(--login-transition);
    outline: none;
}
.rdn-input-btn:hover { color: var(--login-blue-1); }

/* ── LOGIN BUTTON ────────────────────────────────────────────── */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--login-blue-1) 0%, var(--login-blue-2) 55%, var(--login-blue-3) 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--login-radius);
    box-shadow: 0 6px 20px rgba(6, 41, 90, .45);
    cursor: pointer;
    transition: all var(--login-transition);
    margin-top: 6px;
    position: relative;
    overflow: hidden;
}
.btn-login::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
    pointer-events: none;
}
.btn-login:hover {
    background: linear-gradient(135deg, var(--login-blue-2) 0%, var(--login-blue-3) 100%);
    box-shadow: 0 10px 28px rgba(6, 41, 90, .55);
    transform: translateY(-2px);
}
.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(6, 41, 90, .38);
}

/* Loading spinner inside button */
.btn-login .btn-spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-login.loading .btn-spinner    { display: block; }
.btn-login.loading .btn-label-text { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    /* Stacked layout — let the page scroll naturally if it overflows */
    html, body {
        height: auto;
        max-height: none;
        overflow: auto;
    }
    .login-wrap {
        height: auto;
        max-height: none;
        min-height: 100vh;
        overflow: visible;
        padding: 24px 12px;
    }
    .login-card {
        padding: 24px 18px;
        max-height: none;
        flex-direction: column;
        overflow: visible;
    }
    .login-box {
        max-height: none;
        overflow: visible;
    }
    .login-left {
        align-items: center;
        padding-right: 0;
        margin-bottom: 20px;
        width: 100%;
    }
    .login-brand { justify-content: center; }
    .login-brand-title { text-align: center; }
    .login-brand-sub   { text-align: center; }
    .login-illustration { max-width: 240px; max-height: none; }
}
@media (max-width: 575.98px) {
    .login-card {
        padding: 18px 12px;
        border-radius: 18px;
    }
    .login-box {
        padding: 24px 20px;
        border-radius: 16px;
    }
    .login-box-title { font-size: 1.25rem; }
    .login-brand-logo { height: 52px; }
    .rdn-input { font-size: 0.85rem; padding: 10px 12px 10px 0; }
}

/* ── ALERT / VALIDATION ──────────────────────────────────────── */
.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff2f2;
    border: 1px solid #fca5a5;
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #b91c1c;
    margin-bottom: 18px;
    animation: shakeIn .3s ease;
}
@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}
