/* css/login.css */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --success-color: #51cf66;
    --warning-color: #fcc419;
    --danger-color: #ff6b6b;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

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

body {
    font-family: 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    background: white !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-nav .btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.navbar-nav .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
}

.login-container {
    position: relative;
    min-height: 100vh;
    padding-top: 120px; /* Ditambah untuk memberi jarak dari navbar */
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(106, 17, 203, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Login Card */
.login-card {
    background: white;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease;
    margin: 2rem 0; /* Ditambah margin atas bawah */
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: white;
    color: var(--dark-color);
    padding: 2.5rem 2rem 1.5rem;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.card-body {
    padding: 2rem;
}

/* Navigation Tabs - DIPERBAIKI */
.nav-pills {
    gap: 5px; /* Dikurangi dari 10px menjadi 5px */
}

.nav-pills .nav-link {
    background: none;
    color: var(--dark-color);
    border-radius: 50px;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin: 0 1px; /* Dikurangi dari 2px menjadi 1px */
}

.nav-pills .nav-link:hover {
    background: rgba(106, 17, 203, 0.1);
    color: var(--primary-color);
    border-color: rgba(106, 17, 203, 0.2);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 15px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(106, 17, 203, 0.25);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Input Valid (Hijau) */
.form-control.is-valid {
    border-color: var(--success-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2351cf66' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
    padding-right: 2.5rem;
}

/* Input Invalid (Merah) - KHUSUS untuk Password */
.form-control.is-invalid {
    border-color: var(--danger-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ff6b6b'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ff6b6b' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
    padding-right: 2.5rem;
    animation: shake 0.5s ease-in-out;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.15);
}

/* Efek khusus untuk password error */
#loginPassword.is-invalid,
#registerPassword.is-invalid,
#confirmPassword.is-invalid {
    border-color: var(--danger-color) !important;
    background-color: rgba(255, 107, 107, 0.05);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25);
}

/* Efek khusus untuk usia error - TAMBAHAN BARU */
#childAge.is-invalid {
    border-color: var(--danger-color) !important;
    background-color: rgba(255, 107, 107, 0.05);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 107, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ff6b6b'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ff6b6b' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
    padding-right: 2.5rem;
}

/* Efek focus saat password error */
#loginPassword.is-invalid:focus,
#registerPassword.is-invalid:focus,
#confirmPassword.is-invalid:focus,
#childAge.is-invalid:focus {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.3rem rgba(255, 107, 107, 0.3) !important;
}

/* Select Invalid (Merah) */
.form-select.is-invalid {
    border-color: var(--danger-color) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ff6b6b'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ff6b6b' stroke='none'/%3e%3c/svg%3e"), url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right calc(.375em + 2.1875rem) center, right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem), calc(.75em + .375rem) calc(.75em + .375rem);
    padding-right: 4.125rem;
}

/* Checkbox Invalid (Merah) */
.form-check-input.is-invalid {
    border-color: var(--danger-color) !important;
}

.form-check-input.is-invalid:checked {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

/* Sembunyikan pesan error teks merah */
.invalid-feedback {
    display: none !important;
}

/* Tampilkan pesan bantuan tetap ada */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
    transition: color 0.3s ease;
}

/* Ubah warna pesan bantuan saat input error */
.form-control.is-invalid ~ .form-text {
    color: var(--danger-color);
    font-weight: 500;
}

/* Pesan khusus untuk password error */
#loginPassword.is-invalid ~ .form-text,
#registerPassword.is-invalid ~ .form-text {
    color: var(--danger-color);
    font-weight: 600;
}

/* Pesan khusus untuk usia error - TAMBAHAN BARU */
#childAge.is-invalid ~ .form-text {
    color: var(--danger-color);
    font-weight: 600;
    font-style: italic;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Avatar Selection */
.avatar-selection {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.avatar-option {
    font-size: 2rem;
    text-align: center;
    padding: 10px;
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.05);
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: rgba(106, 17, 203, 0.3);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    background: rgba(106, 17, 203, 0.1);
    transform: scale(1.15);
}

/* Button Styles */
.btn {
    border-radius: 15px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(106, 17, 203, 0.6);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

/* Loading States */
.btn .spinner-border {
    width: 1rem;
    height: 1rem;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Footer */
.footer {
    padding: 1rem 0 !important; /* Dikurangi dari 2rem menjadi 1rem */
}

.footer .row {
    align-items: center;
    min-height: 60px; /* Dikurangi dari 100px menjadi 60px */
}

.footer h5 {
    color: white;
    font-size: 0.9rem; /* Ukuran font sedikit lebih kecil */
}

.footer a {
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white !important;
}

.footer p {
    margin-bottom: 0; /* Menghilangkan margin bawah default */
    font-size: 0.9rem; /* Ukuran font sedikit lebih kecil */
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-card {
        margin: 1rem;
        max-width: none;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .avatar-selection {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-pills .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .login-container {
        padding-top: 100px;
    }
    
    .navbar-nav .btn {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 400px) {
    .card-body {
        padding: 1rem;
    }
    
    .avatar-selection {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .login-container {
        padding-top: 90px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(106, 17, 203, 0.25);
}

/* Animation for form transitions */
.tab-pane {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Password strength indicator */
.password-strength {
    height: 5px;
    border-radius: 5px;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.strength-weak {
    background: var(--danger-color);
    width: 25%;
}

.strength-medium {
    background: var(--warning-color);
    width: 50%;
}

.strength-strong {
    background: var(--success-color);
    width: 100%;
}

/* ==================== */
/* NOTIFICATION STYLES  */
/* ==================== */

/* Custom Alert Notification */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-out 4.7s forwards;
    opacity: 1;
    transform: translateX(0);
    background: white;
}

.custom-alert.alert-success {
    background: linear-gradient(135deg, var(--success-color), #40c057);
    color: white;
    border-left: 5px solid #2b8a3e;
}

.custom-alert.alert-danger {
    background: linear-gradient(135deg, var(--danger-color), #ff5252);
    color: white;
    border-left: 5px solid #c92a2a;
}

.custom-alert.alert-warning {
    background: linear-gradient(135deg, var(--warning-color), #ffd43b);
    color: #212529;
    border-left: 5px solid #e67700;
}

.custom-alert.alert-info {
    background: linear-gradient(135deg, #339af0, #4dabf7);
    color: white;
    border-left: 5px solid #1971c2;
}

.custom-alert .alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-alert .alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.custom-alert .alert-message {
    flex-grow: 1;
    font-weight: 500;
    line-height: 1.4;
}

.custom-alert .alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    transition: opacity 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.custom-alert .alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Untuk notifikasi yang lebih kecil pada mobile */
@media (max-width: 576px) {
    .custom-alert {
        min-width: 280px;
        max-width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        margin: 0 auto;
        top: 80px;
    }
    
    .custom-alert .alert-content {
        gap: 8px;
    }
    
    .custom-alert .alert-icon {
        font-size: 1.2rem;
        width: 28px;
        height: 28px;
    }
}

/* Demo style untuk testing notifikasi */
.demo-notification-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #6a11cb;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
    transition: all 0.3s ease;
    display: none; /* Sembunyikan di production */
}

.demo-notification-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(106, 17, 203, 0.4);
}