/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f2efe9;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden; /* Mencegah scroll */
}

/* Background Animation */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
    pointer-events: none;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ========================================
   LOGO
   ======================================== */
.logo {
    position: fixed;
    left: 30px;
    top: 20px;
    z-index: 1000;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.logo-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.logo:hover .logo-img {
    animation: float 1s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(36, 127, 128, 0.3));
}

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

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    top: -100px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

.toast.show {
    top: 20px;
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: #10b981;
}

.toast.error .toast-icon {
    background: #ef4444;
}

.toast.info .toast-icon {
    background: #3b82f6;
}

.toast.success .toast-icon::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.toast.error .toast-icon::after {
    content: '✕';
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.toast.info .toast-icon::after {
    content: 'i';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

/* ========================================
   LOGIN CONTAINER
   ======================================== */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    max-width: 1000px;
    width: 100%;
    max-height: calc(100vh - 40px); /* Membatasi tinggi maksimal */
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    position: relative;
    z-index: 10;
}

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

/* ========================================
   LEFT SECTION
   ======================================== */
.left-section {
    flex: 1;
    padding: 40px 30px;
    background: linear-gradient(135deg, #a7d6db 0%, #48A6A7 50%, #1c75a1 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.left-section::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: -100px;
    left: -100px;
}

.left-section::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    bottom: -50px;
    right: -50px;
}

.welcome-text {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.welcome-text h1 {
    font-size: 32px;
    color: white;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    animation: fadeInLeft 0.8s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alchemy-text {
    font-style: italic;
    color: #ffd700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

.illustration {
    max-width: 220px;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
}

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

/* ========================================
   RIGHT SECTION
   ======================================== */
.right-section {
    flex: 1;
    padding: 40px 40px;
    background: #f2efe9;
    animation: fadeInRight 0.8s ease-out;
    overflow-y: auto; /* Scroll hanya di dalam section ini jika perlu */
    max-height: calc(100vh - 40px);
}

.right-section::-webkit-scrollbar {
    width: 6px;
}

.right-section::-webkit-scrollbar-track {
    background: transparent;
}

.right-section::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.right-section::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-header h2 {
    font-size: 28px;
    color: #247f80;
    margin-bottom: 24px;
    font-weight: 700;
    text-align: center;
}

/* ========================================
   ALERTS
   ======================================== */
.alert, .session-alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    animation: slideDown 0.4s ease-out;
}

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

.alert-info, .session-alert {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #247f80;
    font-weight: 600;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    stroke: #9ca3af;
    stroke-width: 2;
    pointer-events: none;
    transition: stroke 0.3s;
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    stroke: #48A6A7;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: #f9fafb;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #48A6A7;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
    color: #9ca3af;
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-password:hover {
    background: #f3f4f6;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: #6b7280;
    stroke-width: 2;
    transition: stroke 0.2s;
}

.toggle-password:hover svg {
    stroke: #374151;
}

.error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ========================================
   BUTTONS
   ======================================== */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #5fcfd1 0%, #136b97 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner circle {
    stroke-dasharray: 50;
    stroke-dashoffset: 25;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   DIVIDER
   ======================================== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #878f9e;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #c5ccd9;
}

.divider span {
    padding: 0 12px;
}

/* ========================================
   GOOGLE BUTTON
   ======================================== */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 11px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.google-btn:hover {
    background: #f9fafb;
    border-color: #48A6A7;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* ========================================
   REGISTER LINK
   ======================================== */
.register-link {
    text-align: center;
    margin-top: 20px;
    color: black;
    font-size: 13px;
}

.register-link a {
    color: #48A6A7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.register-link a:hover {
    color: #025c89;
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .logo {
        top: 15px;
        left: 15px;
        font-size: 20px;
    }

    .login-container {
        flex-direction: column;
        max-height: calc(100vh - 20px);
    }

    .left-section {
        padding: 30px 20px;
    }

    .welcome-text h1 {
        font-size: 24px;
    }

    .illustration {
        max-width: 160px;
    }

    .right-section {
        padding: 30px 25px;
    }

    .login-header h2 {
        font-size: 24px;
    }

    .toast {
        min-width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
}
