/* =========================================================
   Central Turbo V2 - Premium SaaS Glassmorphism Login
   Design: High-end SaaS, Frosted Glass, Ambient Shadows,
           60FPS Smooth Transitions, Shimmering Gradient Inputs
   Warna Original: Slate Navy (#0f172a, #1e293b) & Crimson (#ef4444)
========================================================= */

:root {
    --bg-canvas: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.6);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --line-soft: rgba(219, 229, 240, 0.8);
    
    --primary: #0f172a;
    --primary-hover: #020617;
    
    --crimson: #ef4444;
    --crimson-gradient: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    
    --danger-bg: #fef2f2;
    --danger-text: #b42318;
    --danger-line: rgba(254, 202, 202, 0.7);

    /* Layered Ambient Depth Shadows */
    --ambient-shadow: 0 1px 3px rgba(15, 23, 42, 0.01),
                       0 24px 64px rgba(15, 23, 42, 0.08),
                       inset 0 1px 0 rgba(255, 255, 255, 0.85);

    /* Animation Timing */
    --saas-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --saas-duration: 0.4s;
    
    /* Shake Curve */
    --bounce-curve: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: 
        radial-gradient(circle at 10% 20%, rgba(15, 23, 42, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.035) 0%, transparent 40%),
        var(--bg-canvas);
    color: var(--text-main);
    font-family: "Plus Jakarta Sans", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* ===============================
   Main Layout & Card Container
   =============================== */
.auth-page {
    width: 100%;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authPageFade 0.4s var(--saas-ease) both;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 26px;
    padding: 36px 32px;
    box-shadow: var(--ambient-shadow);
    overflow: hidden;
    isolation: isolate;
    animation: authCardEnter 0.55s var(--saas-ease) both;
    will-change: transform, opacity;
}

/* ===============================
   Brand Logo & Copy Styling
   =============================== */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    animation: authBrandEnter 0.5s var(--saas-ease) both;
    animation-delay: 0.08s;
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.08));
}

.brand-title {
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: var(--text-main);
}

.brand-title span:last-child {
    color: #dc2626; /* Menyamakan dengan warna merah solid logo CT */
}

.brand-sub {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.title {
    font-size: 30px;
    font-weight: 900;
    margin: 12px 0 6px;
    padding-bottom: 6px; /* Mencegah descender huruf 'g' kepotong saat memakai background-clip */
    letter-spacing: -0.05em;
    line-height: 1.25; /* Ruang aman untuk huruf dengan ekor bawah */
    animation: authBrandEnter 0.5s var(--saas-ease) both;
    animation-delay: 0.14s;
    background: linear-gradient(135deg, var(--primary) 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.5;
    animation: authBrandEnter 0.5s var(--saas-ease) both;
    animation-delay: 0.18s;
}

/* ===============================
   Form Blocks & Frosted Input Fields
   =============================== */
.auth-form {
    margin-top: 24px;
}

.form-block + .form-block {
    margin-top: 18px;
}

.form-block {
    animation: authBrandEnter 0.5s var(--saas-ease) both;
}

.form-block:nth-of-type(1) { animation-delay: 0.22s; }
.form-block:nth-of-type(2) { animation-delay: 0.27s; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.field {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.01);
    transition: all var(--saas-duration) var(--saas-ease);
}

.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
    transition: color var(--saas-duration) var(--saas-ease);
}

.form-control {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    border: 0;
    background: transparent;
    padding: 10px 16px 10px 42px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    transition: all var(--saas-duration) var(--saas-ease);
}

.form-control::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    box-shadow: none;
}

.field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08), 
                0 4px 12px rgba(15, 23, 42, 0.02);
    background: #ffffff;
    transform: translateY(-1px);
}

.field:focus-within .field-icon {
    color: var(--primary);
}

.password-field .form-control {
    padding-right: 48px;
}

/* ===============================
   Password Eye Toggle
   =============================== */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--saas-duration) var(--saas-ease);
}

.password-toggle:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: scale(1.05);
}

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

/* ===============================
   Metallic Submit Button & Loader
   =============================== */
.btn-submit {
    width: 100%;
    margin-top: 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 800;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all var(--saas-duration) var(--saas-ease);
}

.btn-submit:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

.btn-submit.is-loading {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    box-shadow: none !important;
    pointer-events: none;
    transform: none !important;
}

@keyframes loginSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-spin {
    display: inline-block;
    animation: loginSpinner 1s linear infinite;
}

/* ===============================
   Danger & Security Alerts
   =============================== */
.alert-danger {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-line);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(180, 35, 24, 0.03);
    animation: authAlertIn 0.3s var(--saas-ease) both, 
               authSubtleShake 0.32s var(--saas-ease) 0.08s both;
}

/* ===============================
   Login Welcome Cover Panel (Frosted Glass)
   =============================== */
.auth-cover-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Form hidden state under welcome cover */
.auth-cover-card .brand,
.auth-cover-card .title,
.auth-cover-card .subtitle,
.auth-cover-card .alert-danger,
.auth-cover-card .auth-form {
    opacity: 0;
    transform: translateY(38px);
    filter: blur(8px);
    pointer-events: none;
    transition:
        opacity 0.65s var(--saas-ease),
        transform 0.65s var(--saas-ease),
        filter 0.65s ease;
}

/* Form revealed state */
.auth-cover-card.is-revealed .brand,
.auth-cover-card.is-revealed .title,
.auth-cover-card.is-revealed .subtitle,
.auth-cover-card.is-revealed .alert-danger,
.auth-cover-card.is-revealed .auth-form {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    pointer-events: auto;
}

.auth-cover-card.is-revealed .brand { transition-delay: 0.1s; }
.auth-cover-card.is-revealed .title { transition-delay: 0.15s; }
.auth-cover-card.is-revealed .subtitle { transition-delay: 0.18s; }
.auth-cover-card.is-revealed .alert-danger { transition-delay: 0.2s; }
.auth-cover-card.is-revealed .auth-form { transition-delay: 0.24s; }

/* Frosted Welcome Cover */
.welcome-cover {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.86);
    backdrop-filter: blur(24px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition:
        opacity 0.65s var(--saas-ease),
        transform 0.65s var(--saas-ease),
        filter 0.65s ease,
        visibility 0.65s ease;
}

/* Welcome Cover Slides Up Out of view */
.auth-cover-card.is-revealed .welcome-cover {
    opacity: 0;
    transform: translateY(-56px);
    filter: blur(12px);
    visibility: hidden;
    pointer-events: none;
}

.welcome-center {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.welcome-center-content {
    display: grid;
    gap: 12px;
    justify-items: center;
    animation: welcomeFadeUp 0.5s var(--saas-ease) both;
}

.welcome-greeting {
    color: rgba(226, 232, 240, 0.7);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.welcome-only-title {
    margin: 0;
    color: #ffffff;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

/* Glowing Title Underline */
.welcome-only-title::after {
    content: "";
    display: block;
    width: 86px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: var(--crimson-gradient);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.welcome-small-text {
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Hidden elements cleanup */
.welcome-badge,
.welcome-mini-list,
.welcome-signin {
    display: none !important;
}

/* ===============================
   Animations Keyframes
   =============================== */
@keyframes authPageFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes authBrandEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authAlertIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authSubtleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-3px); }
}

@keyframes welcomeFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ===============================
   Responsive Breakpoints & Reduced Motion
   =============================== */
@media (max-width: 480px) {
    .welcome-only-title {
        font-size: 34px;
    }
    
    .auth-card {
        padding: 28px 24px;
        border-radius: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page,
    .auth-card,
    .auth-card * ,
    .welcome-cover,
    .welcome-center-content,
    .alert-danger {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        filter: none !important;
    }
}