/* Auth Style - Soft Blue & White Design - Lightweight & Responsive */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('../images/bg-login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Overlay untuk membuat background lebih halus */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.1);
    z-index: 0;
}

.auth-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    z-index: 1;
}

.register-card {
    max-width: 800px !important;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 
                0 0 0 1px rgba(255, 255, 255, 0.3);
    padding: 40px;
    position: relative;
    z-index: 10;
    max-width: 450px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-out 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    position: relative;
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.logo-fallback i {
    font-size: 48px;
    color: #ffffff;
    margin: 0;
}

.auth-header i {
    font-size: 56px;
    color: #4a90e2;
    margin-bottom: 12px;
}

.auth-header h2 {
    color: #2c3e50;
    font-size: 26px;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-header p {
    color: #64748b;
    font-size: 14px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

/* Button link untuk reset password */
.btn-link {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.btn-link:hover {
    background: linear-gradient(135deg, #357abd 0%, #2c5aa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
    color: white !important;
    text-decoration: none;
}

.auth-form {
    margin-top: 20px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e3e8ef;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    color: #4a90e2;
    margin-bottom: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #ffffff;
    color: #2c3e50;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #ffffff;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #2868a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: #64748b;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #475569;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e3e8ef;
}

.auth-footer p {
    color: #64748b;
    font-size: 14px;
}

.auth-footer a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4a90e2;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.back-link:hover {
    gap: 8px;
    color: #357abd;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .auth-card {
        padding: 30px 24px;
    }

    .auth-header h2 {
        font-size: 24px;
    }

    .auth-header i {
        font-size: 48px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group.full-width {
        grid-column: 1;
    }

    .form-section h4 {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }

    .auth-header h2 {
        font-size: 22px;
    }

    .auth-header i {
        font-size: 42px;
    }
    
    .auth-logo {
        width: 80px;
        height: 80px;
    }
    
    .logo-fallback i {
        font-size: 38px;
    }

    .form-control {
        padding: 9px 12px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 11px;
        font-size: 14px;
    }
}

/* ========== Loading State ========== */

/* Keamanan: sembunyikan elemen daftar siswa jika ada yang disisipkan pada halaman auth */
.auth-card .student-list,
.auth-card .siswa-list,
.auth-card .daftar-siswa,
.auth-bg .student-list,
.auth-bg .siswa-list {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}
.btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    box-shadow: none;
}

/* ========== Form Validation ========== */
.form-control.is-invalid {
    border-color: #ef4444;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: #10b981;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.invalid-feedback {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.valid-feedback {
    color: #10b981;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* ========== Lupa Password ========== */
.forgot-password-link {
    color: #4a90e2;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.forgot-password-link:hover {
    color: #357abd;
    text-decoration: underline;
}

.text-right {
    text-align: right;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e3e8ef;
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 15px;
    color: #94a3b8;
    font-size: 13px;
    position: relative;
}

.alternative-method {
    margin-top: 15px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
