/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif !important;
    min-height: 100dvh;                    /* ← perbaikan utama: pakai dynamic viewport */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 1.5rem;                       /* padding lebih kecil & aman */
    overflow-y: auto;                      /* bisa scroll kalau konten panjang */
    -webkit-overflow-scrolling: touch;     /* smooth scroll di iOS */
    position: relative;
}

/* ===== ANIMATED BACKGROUND ===== */
.animated-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 { width: 300px; height: 300px; top: -100px; left: -100px; }
.shape-2 { width: 200px; height: 200px; top: 50%; right: -50px; animation-delay: 2s; }
.shape-3 { width: 250px; height: 250px; bottom: -80px; left: 30%; animation-delay: 4s; }
.shape-4 { width: 150px; height: 150px; top: 20%; right: 20%; animation-delay: 6s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(50px, 50px) rotate(90deg); }
    50%  { transform: translate(-30px, 80px) rotate(180deg); }
    75%  { transform: translate(60px, -40px) rotate(270deg); }
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
    width: 100%;
    max-width: 460px;
    margin: 2rem auto;                    /* ← center dengan margin, bukan flex */
    position: relative;
    z-index: 10;
    animation: fadeInScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}



@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== LOGIN CARD ===== */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    overflow: hidden;
    position: relative;
}

/* ===== CARD DECORATION ===== */
.card-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
}

.circle-1 { width: 150px; height: 150px; top: -50px; right: -30px; animation: pulse 3s infinite; }
.circle-2 { width: 100px; height: 100px; top: 30px; left: -20px; animation: pulse 4s infinite; animation-delay: 1s; }
.circle-3 { width: 80px; height: 80px; top: 80px; right: 50px; animation: pulse 5s infinite; animation-delay: 2s; }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50%      { transform: scale(1.2); opacity: 0.6; }
}

/* ===== HEADER ===== */
.login-header {
    padding: 50px 35px 35px;
    text-align: center;
    position: relative;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.logo-container img {
    max-width: 70px;
    max-height: 70px;
    object-fit: contain;
}

.welcome-title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 8px;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.welcome-subtitle {
    color: #64748b;
    font-size: 13px;
    font-weight: 400;
}

/* ===== BODY ===== */
.login-body {
    padding: 0 35px 35px;
}

/* ===== CUSTOM ALERT ===== */
.custom-alert {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== FORM STYLES ===== */
.form-label {
    font-size: 13px !important;
    color: #1e293b !important;
    margin-bottom: 8px !important;
}

.input-group-custom {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6366f1;
    font-size: 15px;
    z-index: 10;
    pointer-events: none;
}

.input-group-custom .form-control {
    height: 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    padding-left: 45px;
    padding-right: 45px;
    transition: all 0.3s ease;
}

.input-group-custom .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group-custom .form-control::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    background: #f1f5f9;
    color: #6366f1;
}

/* ===== CHECKBOX & LINK ===== */
.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
}

.form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

.form-check-label {
    font-size: 13px;
    color: #64748b;
    margin-left: 5px;
}

.forgot-link {
    font-size: 13px;
    color: #6366f1 !important;
    font-weight: 500;
}

.forgot-link:hover {
    color: #764ba2 !important;
}

/* ===== BUTTON ===== */
.btn-login {
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-content {
    position: relative;
    z-index: 2;
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to { left: 100%; }
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* ===== OUTLINE BUTTON ===== */
.btn-outline-custom {
    padding: 10px 26px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #6366f1;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.4s ease;
}

.btn-outline-custom:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* ===== DIVIDER ===== */
.divider {
    text-align: center;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.divider span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0 12px;
    color: #94a3b8;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* ===== FOOTER ===== */
.login-footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    padding: 16px 35px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.copyright {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.developer {
    font-size: 11px;
    color: #94a3b8;
}

/* ==============================================
   RESPONSIVE ADJUSTMENTS
=============================================== */

@media (max-width: 576px) {
    body {
        padding: 1rem;
    }

    .login-container {
        margin: 1.5rem auto;
    }

    .login-header {
        padding: 40px 25px 30px;
    }

    .login-body {
        padding: 0 25px 30px;
    }

    .login-footer {
        padding: 14px 25px;
    }

    .logo-container {
        width: 90px;
        height: 90px;
    }

    .logo-container img {
        max-width: 60px;
        max-height: 60px;
    }

    .welcome-title {
        font-size: 26px;
    }

    .btn-login {
        height: 48px;
    }
}

/* Untuk layar sangat pendek (contoh: iPhone SE landscape, atau hp murah) */
@media (max-height: 680px) {
    body {
        padding: 0.8rem;
    }

    .login-container {
        margin: 1rem auto;
    }

    .login-header {
        padding: 35px 20px 25px !important;
    }

    .login-body {
        padding: 0 20px 25px !important;
    }

    .card-decoration {
        height: 160px;
    }

    .welcome-title {
        font-size: 24px;
    }
}

