/* ========================================= */
/* RESET & BASE STYLES */
/* ========================================= */

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

/* Root variables - diselaraskan dengan tema biru-hijau (referensi Webmail Dashboard) */
:root {
    --navy: #16233F;
    --navy2: #0B1526;
    --navy3: #16305A;
    --ink: #1E293B;
    --mut: #64748B;
    --paper: #EAF3FE;
    --card: #FFFFFF;
    --line: #DCE8F7;
    --orange: #2F6FEE;
    --orange-d: #16A34A;
    --gold: #2F6FEE;
    --gold-l: #7FB0FA;
    --sky: #2F6FEE;
    --green: #22C55E;
    --red: #E5484D;

    --disp: 'Sora', sans-serif;
    --body: 'Plus Jakarta Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 11px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.5s ease;
}

html {
    scroll-behavior: smooth;
    background-color: var(--paper);
    background-image: radial-gradient(rgba(11, 31, 58, .16) 1.4px, transparent 1.4px);
    background-size: 26px 26px;
}

body {
    font-family: var(--body);
    min-height: 100vh;
    color: var(--ink);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ========================================= */
/* LOADING SCREEN */
/* ========================================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-d) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
    color: var(--card);
}

.loader-logo {
    height: 76px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .3));
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.loader-text {
    font: 600 14px var(--body);
    opacity: 0.9;
    letter-spacing: 0.5px;
    color: #cfe0f4;
}

/* ========================================= */
/* MAIL RAIN BACKGROUND ANIMATION */
/* ========================================= */

.mail-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.mail-rain-icon {
    position: absolute;
    top: -8%;
    color: var(--orange);
    opacity: 0;
    animation-name: mailFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}

.mail-rain-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes mailFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    8% {
        opacity: var(--mail-opacity, .35);
    }
    92% {
        opacity: var(--mail-opacity, .35);
    }
    100% {
        transform: translateY(112vh) rotate(20deg);
        opacity: 0;
    }
}

/* ========================================= */
/* DECORATIVE SPLASH SHAPES */
/* ========================================= */

.splash-decor {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.splash {
    position: absolute;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-d) 100%);
    opacity: .16;
    animation: splashFloat 10s ease-in-out infinite, blobMorph 14s ease-in-out infinite;
}

.splash-left-1 {
    top: 6%;
    left: -110px;
    width: 260px;
    height: 260px;
    border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
    animation-duration: 11s, 16s;
}

.splash-left-2 {
    top: 48%;
    left: -60px;
    width: 130px;
    height: 130px;
    border-radius: 58% 42% 35% 65% / 55% 60% 40% 45%;
    opacity: .12;
    animation-duration: 8s, 12s;
    animation-delay: 1s, 0s;
}

.splash-left-3 {
    bottom: 4%;
    left: -90px;
    width: 190px;
    height: 190px;
    border-radius: 35% 65% 55% 45% / 40% 55% 45% 60%;
    opacity: .14;
    animation-duration: 13s, 18s;
    animation-delay: 2s, 3s;
}

.splash-right-1 {
    top: 12%;
    right: -120px;
    width: 300px;
    height: 300px;
    border-radius: 58% 42% 35% 65% / 55% 60% 40% 45%;
    opacity: .15;
    animation-duration: 12s, 15s;
}

.splash-right-2 {
    top: 58%;
    right: -50px;
    width: 110px;
    height: 110px;
    border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
    opacity: .1;
    animation-duration: 9s, 13s;
    animation-delay: .5s, 1.5s;
}

.splash-right-3 {
    bottom: 6%;
    right: -80px;
    width: 170px;
    height: 170px;
    border-radius: 35% 65% 55% 45% / 40% 55% 45% 60%;
    opacity: .13;
    animation-duration: 10s, 17s;
    animation-delay: 1.5s, .8s;
}

@keyframes splashFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-18px) translateX(8px); }
}

/* ========================================= */
/* HEADER */
/* ========================================= */

.header {
    padding: 22px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-d) 100%);
    border-bottom: 3px solid var(--gold-l);
    border-top: 3px solid var(--gold-l);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo-svg {
    height: 62px;
    width: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    text-align: left;
}

.logo-title {
    font: 800 30px var(--disp);
    color: #fff;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.logo-subtitle {
    font: 600 11px var(--body);
    color: #fff;
    letter-spacing: normal;
    text-transform: uppercase;
    margin-top: 4px;
    width: 100%;
    text-align-last: justify;
    text-align: justify;
}

/* ========================================= */
/* MAIN CONTENT */
/* ========================================= */

.main {
    flex: 1;
    padding: 44px 20px;
    position: relative;
    z-index: 10;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 34px;
}

/* ========================================= */
/* LOGIN CARD */
/* ========================================= */

.login-card {
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
    padding: 70px 56px 46px;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-d) 100%);
    border: 1.5px solid var(--gold-l);
    border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
    box-shadow: 0 18px 40px -22px rgba(11, 31, 58, .5);
    position: relative;
    animation: blobMorph 12s ease-in-out infinite;
}

@keyframes blobMorph {
    0%, 100% {
        border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
    }
    33% {
        border-radius: 58% 42% 35% 65% / 55% 60% 40% 45%;
    }
    66% {
        border-radius: 35% 65% 55% 45% / 40% 55% 45% 60%;
    }
}

.card-tag {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, .12);
}

/* Icon Email di atas card */
.mail-icon {
    text-align: center;
    margin-bottom: 26px;
    margin-top: 14px;
}

.mail-icon svg {
    width: 60px;
    height: 60px;
    padding: 15px;
    background: rgba(255, 255, 255, .16);
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: 16px;
    box-shadow: 0 10px 24px -10px rgba(11, 31, 58, .5);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.portal-title {
    text-align: center;
    font: 800 28px var(--disp);
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: -.01em;
}

.portal-description {
    text-align: center;
    color: #dcebff;
    font-size: 14px;
    margin-bottom: 30px;
}

/* ========================================= */
/* BUTTON LOGIN (Ripple Effect) */
/* ========================================= */

.btn-login {
    width: 100%;
    padding: 15px 20px;
    font: 700 15px var(--body);
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    letter-spacing: 0.3px;
    box-shadow: 0 10px 24px -10px rgba(11, 31, 58, .5);
}

.btn-login:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .26);
    color: #fff;
    border-color: rgba(255, 255, 255, .6);
    box-shadow: 0 10px 24px -10px rgba(11, 31, 58, .45);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.btn-login:hover .btn-icon {
    transform: translateX(3px);
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(19, 49, 77, 0.35);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================= */
/* DIVIDER */
/* ========================================= */

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 26px 0 20px;
}

.divider::before,
.divider::after {
    content: '';
    width: 36px;
    height: 1px;
    background: rgba(255, 255, 255, .3);
}

.divider-text {
    padding: 0 15px;
    font: 700 11px var(--body);
    color: #dcebff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================= */
/* SECURITY INFO */
/* ========================================= */

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: -8px;
    font-size: 12px;
    font-weight: 600;
    color: #dcebff;
}

.security-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ========================================= */
/* TAG (chip kecil, dipakai di card-tag) */
/* ========================================= */

.tag {
    font: 700 .68rem var(--body);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--orange);
    border: 1.5px solid var(--orange);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    background: var(--card);
}

/* ========================================= */
/* QUICK ACCESS CARDS */
/* ========================================= */

.quick-access {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.quick-title {
    text-align: center;
    margin-bottom: 18px;
}

.eyebrow-mini {
    font: 800 .78rem var(--body);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--orange);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.eyebrow-mini::before,
.eyebrow-mini::after {
    content: "";
    width: 24px;
    height: 3px;
    background: var(--orange);
}

.quick-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 22px 15px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--navy);
    font: 700 13px var(--body);
    transition: all var(--transition-normal);
}

.quick-card svg {
    width: 26px;
    height: 26px;
    color: var(--orange);
    transition: transform var(--transition-normal);
}

.quick-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow: 0 14px 28px -16px rgba(11, 31, 58, .4);
    color: var(--orange);
}

.quick-card:hover svg {
    transform: scale(1.15);
    color: var(--gold);
}

/* ========================================= */
/* FOOTER */
/* ========================================= */

.footer {
    padding: 24px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    background: var(--navy2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
}

.copyright {
    font-size: 12px;
    color: #9db4d0;
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-link {
    font-size: 12px;
    color: #9db4d0;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--gold-l);
}

.footer-divider {
    color: #4a5f7d;
}

/* ========================================= */
/* FADE-IN ANIMATION */
/* ========================================= */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================= */
/* RESPONSIVE DESIGN */
/* ========================================= */

@media (max-width: 768px) {
    .logo-title { font-size: 26px; }
    .logo-svg { height: 54px; width: auto; }
    .login-card { padding: 34px 26px; }
    .portal-title { font-size: 24px; }
    .quick-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .header { padding: 18px 15px; }
    .logo-container { flex-direction: column; gap: 10px; }
    .logo-text { text-align: center; }
    .logo-title { font-size: 24px; }
    .main { padding: 32px 15px; }
    .login-card { padding: 30px 20px; border-radius: var(--radius-lg); }
    .portal-title { font-size: 22px; }
    .quick-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .footer-links { flex-direction: column; gap: 5px; }
    .footer-divider { display: none; }
}

@media (max-width: 360px) {
    .logo-title { font-size: 20px; }
    .login-card { padding: 24px 16px; }
}
