:root {
    --bg: #f3f7fc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbe5f0;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --danger-bg: #fef2f2;
    --danger-text: #b42318;
    --danger-line: #fecaca;
    --red: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    font-family: "Plus Jakarta Sans", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.brand img {
    width: 36px;
}

.brand-title {
    font-weight: 800;
    font-size: 14px;
}

.brand-title span:last-child {
    color: var(--red);
}

.brand-sub {
    font-size: 11px;
    color: var(--muted);
}

.title {
    font-size: 28px;
    font-weight: 800;
    margin: 10px 0 4px;
}

.subtitle {
    font-size: 14px;
    color: var(--muted);
}

.alert-danger {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-line);
    font-size: 13px;
    font-weight: 600;
}

.auth-form {
    margin-top: 20px;
}

.form-block + .form-block {
    margin-top: 14px;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
}

.field {
    position: relative;
}

.field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.form-control {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 10px 12px 10px 36px;
}

.btn-submit {
    width: 100%;
    margin-top: 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, #2d6df6, #1d4ed8);
    color: #fff;
    border: none;
    font-weight: 700;
    min-height: 46px;
}
/* ===============================
   Login Smooth Animation
   =============================== */

@keyframes authPageFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes authBrandEnter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authAlertIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authSubtleShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    50% {
        transform: translateX(3px);
    }
    75% {
        transform: translateX(-2px);
    }
}

.auth-page {
    animation: authPageFade .35s ease both;
}

.auth-card {
    animation: authCardEnter .46s cubic-bezier(.22, 1, .36, 1) both;
    will-change: transform, opacity;
}

.auth-card .brand {
    animation: authBrandEnter .42s ease both;
    animation-delay: .08s;
}

.auth-card .title {
    animation: authBrandEnter .42s ease both;
    animation-delay: .14s;
}

.auth-card .subtitle {
    animation: authBrandEnter .42s ease both;
    animation-delay: .18s;
}

.auth-form .form-block {
    animation: authBrandEnter .42s ease both;
}

.auth-form .form-block:nth-of-type(1) {
    animation-delay: .22s;
}

.auth-form .form-block:nth-of-type(2) {
    animation-delay: .27s;
}

.btn-submit {
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.btn-submit:hover {
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0) scale(.99);
}

.field {
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.field:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .10);
    background: #ffffff;
}

.field:focus-within .field-icon {
    color: #1d4ed8;
}

.alert-danger {
    animation: authAlertIn .25s ease both, authSubtleShake .28s ease .08s both;
}

@media (prefers-reduced-motion: reduce) {
    .auth-page,
    .auth-card,
    .auth-card .brand,
    .auth-card .title,
    .auth-card .subtitle,
    .auth-form .form-block,
    .alert-danger {
        animation: none !important;
    }

    .btn-submit,
    .field {
        transition: none !important;
    }
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    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: background .18s ease, color .18s ease;
}

.password-toggle:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

/* ===============================
   Login Welcome - Plain Center Reveal
   =============================== */

.auth-cover-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* form login di bawah, awalnya tersembunyi */
.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 .62s cubic-bezier(.22, 1, .36, 1),
        transform .62s cubic-bezier(.22, 1, .36, 1),
        filter .62s ease;
}

/* setelah reveal, form naik masuk */
.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: .14s;
}

.auth-cover-card.is-revealed .title {
    transition-delay: .19s;
}

.auth-cover-card.is-revealed .subtitle {
    transition-delay: .23s;
}

.auth-cover-card.is-revealed .alert-danger {
    transition-delay: .25s;
}

.auth-cover-card.is-revealed .auth-form {
    transition-delay: .30s;
}

/* cover welcome */
.welcome-cover {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    cursor: pointer;
    background: #ffffff;
    transition:
        opacity .62s cubic-bezier(.22, 1, .36, 1),
        transform .62s cubic-bezier(.22, 1, .36, 1),
        filter .62s ease,
        visibility .62s ease;
}

.welcome-cover::before {
    content: none;
}

/* saat login muncul, cover welcome naik keluar */
.auth-cover-card.is-revealed .welcome-cover {
    opacity: 0;
    transform: translateY(-52px);
    filter: blur(10px);
    visibility: hidden;
    pointer-events: none;
}

/* isi welcome di tengah */
.welcome-greeting {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.welcome-center {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.welcome-center-content {
    display: grid;
    gap: 10px;
    justify-items: center;
    animation: welcomeFadeUp .48s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes welcomeFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.welcome-only-title {
    margin: 0;
    color: #0f172a;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: 1.05;
}

.welcome-only-title::after {
    content: "";
    display: block;
    width: 86px;
    height: 4px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: #e3342f;
}

.welcome-small-text {
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(227, 52, 47, .10);
    color: #b42318;
    border: 1px solid rgba(227, 52, 47, .16);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* hapus style lama yang tidak dipakai */
.welcome-badge,
.welcome-mini-list,
.welcome-signin {
    display: none !important;
}

@media (max-width: 480px) {
    .welcome-only-title {
        font-size: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-cover,
    .auth-cover-card .brand,
    .auth-cover-card .title,
    .auth-cover-card .subtitle,
    .auth-cover-card .alert-danger,
    .auth-cover-card .auth-form {
        transition: none !important;
        filter: none !important;
    }
}