/* ============================================================
   AUTH - LOGIN & REGISTER (SIMPLE & RESPONSIVE + ANIMASI)
   ============================================================ */

/* ===== GLOBAL ===== */
* {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

/* ===== CARD ===== */
.auth-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px 35px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(13, 110, 253, 0.35);
    animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 25px;
}



@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(13, 110, 253, 0.15);
    }
}

.auth-card .logo i:hover {
    transform: rotate(-5deg) scale(1.1);
}

.auth-card .logo h3 {
    font-weight: 700;
    color: #1e293b;
    margin-top: 10px;
    font-size: 1.4rem;
}

.auth-card .logo p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

/* ===== TAB ===== */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
}

.auth-tabs .tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-tabs .tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #0d6efd;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 10px;
}

.auth-tabs .tab-btn.active {
    background: #ffffff;
    color: #0d6efd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-tabs .tab-btn.active::after {
    width: 60%;
}

.auth-tabs .tab-btn:hover:not(.active) {
    color: #1e293b;
}

.auth-tabs .tab-btn:active {
    transform: scale(0.97);
}

/* ===== FORM ===== */
.auth-form {
    display: none;
    animation: formFadeIn 0.5s ease-out;
}

.auth-form.active {
    display: block;
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-form .form-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.auth-form .form-subtitle {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 16px;
}

/* ===== INPUT GROUP ===== */
.input-group-custom {
    position: relative;
    margin-bottom: 14px;
}

/* Icon kiri (username, lock) */
.input-group-custom .input-icon-left {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    z-index: 1;
    transition: all 0.3s ease;
}

.input-group-custom:focus-within .input-icon-left {
    color: #0d6efd;
}

/* Icon kanan (show/hide password) */
.input-group-custom .input-icon-right {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
    z-index: 1;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    padding: 4px;
}

.input-group-custom .input-icon-right:hover {
    color: #0d6efd;
    transform: translateY(-50%) scale(1.1);
}

.input-group-custom .input-icon-right.active {
    color: #0d6efd;
}

.input-group-custom input {
    width: 100%;
    padding: 11px 44px 11px 44px;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    font-size: 0.9rem;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

.input-group-custom input:focus {
    border-color: #0d6efd;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    transform: translateY(-1px);
}

.input-group-custom input::placeholder {
    color: #94a3b8;
    transition: opacity 0.3s ease;
}

.input-group-custom input:focus::placeholder {
    opacity: 0.5;
}

/* Shake animation untuk error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ===== BUTTON ===== */
.btn-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 6px;
    position: relative;
    overflow: hidden;
}

.btn-submit::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: left 0.6s ease;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(13, 110, 253, 0.4);
}

.btn-submit:active {
    transform: translateY(0) scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading spinner pada button */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== LINK ===== */
.auth-link {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 14px;
}

.auth-link b {
    color: #0d6efd;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.auth-link b::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0d6efd;
    transition: width 0.3s ease;
}

.auth-link b:hover::after {
    width: 100%;
}

.auth-link b:hover {
    color: #0a58ca;
}

/* ===== ALERT ===== */
.alert-custom {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-bottom: 14px;
    animation: alertSlideIn 0.4s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alert-custom.alert-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-custom.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ===== DEMO INFO ===== */
.demo-info {
    text-align: center;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 10px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
    transition: all 0.3s ease;
}

.demo-info:hover {
    border-color: #0d6efd;
    background: #f0f7ff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .auth-card {
        padding: 20px 18px;
        border-radius: 16px;
    }

    .auth-card .logo i {
        font-size: 32px;
        padding: 10px;
    }

    .auth-card .logo h3 {
        font-size: 1.2rem;
    }

    .auth-tabs .tab-btn {
        font-size: 0.8rem;
        padding: 8px;
    }

    .input-group-custom input {
        padding: 10px 38px 10px 38px;
        font-size: 0.85rem;
    }

    .input-group-custom .input-icon-left {
        font-size: 0.9rem;
        left: 12px;
    }

    .input-group-custom .input-icon-right {
        font-size: 0.9rem;
        right: 12px;
    }

    .btn-submit {
        padding: 10px;
        font-size: 0.9rem;
    }

    .auth-form .form-title {
        font-size: 1rem;
    }

    .auth-form .form-subtitle {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .demo-info {
        font-size: 0.6rem;
    }
}

@media (max-width: 360px) {
    .auth-card {
        padding: 16px 14px;
    }

    .auth-tabs .tab-btn {
        font-size: 0.7rem;
        padding: 6px;
    }

    .input-group-custom input {
        padding: 8px 34px 8px 34px;
        font-size: 0.8rem;
    }

    .input-group-custom .input-icon-left {
        font-size: 0.8rem;
        left: 10px;
    }

    .input-group-custom .input-icon-right {
        font-size: 0.8rem;
        right: 10px;
    }
}