/* ========================================
   LOGIN SECTION (Cinematic Glassmorphism)
   ======================================== */
.login-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: 100dvh;
    height: 100dvh;
    background: linear-gradient(135deg, #f8fafc 0%, #d1fae5 40%, #50C878 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    will-change: opacity, transform;
    transform: translateZ(0);
}

.login-section.is-scrollable {
    align-items: center;
    overflow: hidden;
    padding: 0;
}

.login-entrance {
    animation: fadeInLogin 1.1s ease-out forwards;
    pointer-events: auto;
}

.fade-out-up {
    animation: fadeOutUpLogin 0.5s ease-in forwards;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(80, 200, 120, 0.2), inset 0 0 32px rgba(255, 255, 255, 0.3);
    opacity: 0.6;
}

.el-1 {
    width: 350px;
    height: 350px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    top: -5%;
    left: -5%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(16, 185, 129, 0.2));
    animation: morphFloat 12s ease-in-out infinite alternate;
}

.el-2 {
    width: 500px;
    height: 400px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    bottom: -10%;
    right: -10%;
    background: linear-gradient(135deg, rgba(167, 243, 208, 0.6), rgba(52, 211, 153, 0.2));
    animation: morphFloat 15s ease-in-out infinite alternate-reverse;
}

.el-3 {
    width: 200px;
    height: 250px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 20%;
    right: 15%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(209, 250, 229, 0.4));
    animation: morphFloat 10s ease-in-out infinite alternate;
}

.el-4 {
    width: 250px;
    height: 250px;
    border-radius: 50% 50% 30% 70% / 50% 50% 70% 50%;
    bottom: 15%;
    left: 8%;
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.4), rgba(255, 255, 255, 0.2));
    animation: morphFloat 14s ease-in-out infinite alternate;
    filter: blur(8px);
}

@keyframes morphFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: translateY(-20px) rotate(5deg) scale(1.05);
    }

    66% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
        transform: translateY(10px) rotate(-5deg) scale(0.95);
    }

    100% {
        transform: translateY(-40px) rotate(10deg) scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

.login-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 440px;
    max-height: none;
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    transform: translateY(30px);
    opacity: 0;
    animation: slideUpFade 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    overflow: hidden;
    will-change: transform, opacity;
}

.login-card.signup-mode {
    max-width: 840px;
    padding: 28px 30px 14px;
}

.login-section.is-scrollable .login-card {
    max-height: none;
    overflow: hidden;
}

.login-section.is-scrollable .login-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.login-card.signup-mode .login-header {
    margin-bottom: 16px;
}

.login-card.signup-mode .login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.login-card.signup-mode .login-header h2 {
    font-size: 2rem;
    margin-bottom: 4px;
}

.login-card.signup-mode .login-header p {
    font-size: 0.72rem;
}

.login-card.signup-mode .signup-fields .form-group {
    margin-bottom: 10px;
}

.login-card.signup-mode .login-form label {
    font-size: 0.7rem;
    margin-bottom: 6px;
}

.login-card.signup-mode .login-form input,
.login-card.signup-mode .login-form select {
    padding-top: 12px;
    padding-bottom: 12px;
}

.login-card.signup-mode .btn-masuk {
    margin-top: 8px;
    padding: 12px;
}

.login-card.signup-mode .login-toggle {
    margin-top: 10px;
}

.login-card.signup-mode .login-footer {
    margin-top: 12px;
    padding-top: 10px;
    font-size: 0.68rem;
}

.login-upm-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-upm-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.login-upm-badge span {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--emerald-800);
}

.login-form {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.login-form.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    animation: floatYSoft 4s ease-in-out infinite alternate;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--emerald-900);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--emerald-800);
    opacity: 0.8;
    font-weight: 400;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

#loginError {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 10px;
    display: none;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.signup-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 0;
}

.signup-fields .form-group {
    margin-bottom: 14px;
}

.signup-fields .form-group.full-row {
    grid-column: 1 / -1;
}

.login-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--emerald-900);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--emerald-500);
    font-size: 0.9rem;
    transition: var(--transition-base);
}

.login-form input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    color: var(--emerald-900);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-wrapper:has(.password-toggle) input {
    padding-right: 44px;
}

.login-form input::placeholder {
    color: var(--emerald-600);
    opacity: 0.6;
}

.login-form input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--emerald-400);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.login-form input:focus + .input-icon,
.login-form input:focus ~ .input-icon {
    color: var(--emerald-500);
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--emerald-500);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--emerald-700);
}

.btn-masuk {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--emerald-600);
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.btn-masuk:hover {
    transform: scale(1.02);
    background: var(--emerald-500);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

.btn-masuk:active {
    transform: scale(0.95);
}

.social-login {
    margin-top: 24px;
    text-align: center;
}

.social-text {
    font-size: 0.75rem;
    color: var(--emerald-800);
    opacity: 0.7;
    position: relative;
    display: inline-block;
    padding: 0 10px;
}

.social-text::before,
.social-text::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: rgba(16, 185, 129, 0.3);
}

.social-text::before {
    right: 100%;
}

.social-text::after {
    left: 100%;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 16px;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald-700);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.social-btn:hover {
    background: #ffffff;
    transform: translateY(-2px);
    color: var(--emerald-500);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.15);
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--emerald-800);
    opacity: 0.7;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    padding-top: 16px;
}

@media (max-width: 768px) {
    .login-section,
    .login-section.is-scrollable {
        align-items: flex-start;
        justify-content: center;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 14px 12px;
    }

    .login-card,
    .login-section.is-scrollable .login-card {
        width: 100%;
        max-width: 520px;
        max-height: none;
        margin: 0 auto;
    }

    .login-card.signup-mode {
        max-width: 520px;
    }
}

@media (max-width: 640px) {
    .login-upm-badge {
        top: 10px;
        right: 10px;
        padding: 5px 8px;
        gap: 5px;
    }

    .login-upm-logo {
        width: 18px;
        height: 18px;
    }

    .login-card.signup-mode {
        max-width: 440px;
        padding: 24px 20px 14px;
    }

    .signup-fields {
        grid-template-columns: 1fr;
        column-gap: 0;
    }
}

@media (max-height: 860px) {
    .login-section,
    .login-section.is-scrollable {
        overflow: hidden;
        padding: 0;
    }

    .login-card,
    .login-section.is-scrollable .login-card {
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 28px 24px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .login-card::-webkit-scrollbar,
    .login-section.is-scrollable .login-card::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
    }

    .login-card.signup-mode {
        max-width: 680px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-logo {
        width: 56px;
        height: 56px;
        margin-bottom: 10px;
    }

    .login-header h2 {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .login-form .form-group {
        margin-bottom: 14px;
    }

    .signup-fields {
        grid-template-columns: 1fr;
    }

    .btn-masuk {
        padding: 12px;
    }

    .login-footer {
        margin-top: 20px;
        padding-top: 12px;
    }
}
