/* File: src/Presentation/PSM.Web/wwwroot/css/school-login.css - School-specific Login Design */

/* ===== CORE LAYOUT ===== */
/* School login container - transparent by default, inherits from auth-page background */
.school-login-page-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    font-family: 'Lexend', sans-serif;
    /* Transparent by default - lets auth-page background show through */
    background: transparent;
    position: relative;
}

/* Only add background and overlay when school has custom background */
.school-login-page-container.has-background-image {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Background overlay only for custom school backgrounds */
.school-login-page-container.has-background-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-color, rgba(255, 255, 255, 0.6));
    backdrop-filter: var(--overlay-blur, blur(3px));
    z-index: 0;
}

/* Ensure content is above the overlay (only when overlay exists) */
.school-login-page-container.has-background-image > * {
    position: relative;
    z-index: 1;
}

/* Main login card - centered single column */
.school-login-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

/* ===== SCHOOL BRAND SECTION ===== */
.school-brand-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.school-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.school-logo {
    height: 4rem;
    width: 4rem;
    border-radius: 0.5rem;
    object-fit: cover;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.school-name {
    font-family: 'Lexend', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0.5rem 0 0.25rem 0;
    line-height: 1.2;
}

.school-motto {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    margin: 0;
    line-height: 1.3;
}

/* ===== LOGIN FORM SECTION ===== */
.login-header-text {
    margin-bottom: 2rem;
    text-align: center;
}

.login-header-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-family: 'Lexend', sans-serif;
}

.login-header-text p {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

/* ===== COPYRIGHT NOTICE ===== */
.copyright-notice {
    background: #f9fafb;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin: 1.5rem -1.75rem -1.75rem -1.75rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.copyright-notice p {
    margin: 0;
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.4;
}

.copyright-notice a {
    color: #4b5563;
    text-decoration: none;
}

.copyright-notice a:hover {
    text-decoration: underline;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group:last-of-type {
    margin-bottom: 2rem;
}

/* Form options - remember me and forgot password */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.remember-me .dx-checkbox-text {
    color: #374151;
    font-size: 0.875rem;
}

.forgot-password a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Submit button */
.btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== FOOTER SECTION ===== */
.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.login-footer p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

.login-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #f0f9ff;
    border: 1px solid #c7d2fe;
    color: #1e40af;
}

.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-info {
    background-color: #f0f9ff;
    border: 1px solid #c7d2fe;
    color: #1e40af;
}

.alert-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-header strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.alert-icon {
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 480px) {
    .school-login-page-container {
        padding: 1rem 0.5rem;
    }
    
    .school-login-card {
        padding: 2rem 1.5rem;
        max-width: none;
        margin: 0 0.5rem;
    }
    
    .school-name {
        font-size: 1.25rem;
    }
    
    .login-header-text h2 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .copyright-notice {
        padding: 0.5rem;
    }
    
    .school-logo {
        height: 3rem;
        width: 3rem;
    }
}

@media (max-width: 360px) {
    .school-login-card {
        padding: 1.5rem 1rem;
    }
    
    .school-brand-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    /* Mobile responsive adjustments for custom school backgrounds only */
    .school-login-page-container.has-background-image {
        background-attachment: scroll; /* Fixed attachment can cause issues on mobile */
    }
    
    /* Slightly stronger overlay on small screens for better readability */
    .school-login-page-container.has-background-image::before {
        background: var(--overlay-color, rgba(255, 255, 255, 0.7));
        backdrop-filter: var(--overlay-blur, blur(4px));
    }
}

/* ===== SCHOOL BRANDING OVERRIDES ===== */
/* Dynamic school branding styles that can be overridden by CSS variables */
.btn-primary {
    background-color: var(--school-primary-color, #3b82f6);
    border-color: var(--school-primary-color, #3b82f6);
}

.btn-primary:hover, 
.btn-primary:focus {
    background-color: var(--school-secondary-color, #2563eb);
    border-color: var(--school-secondary-color, #2563eb);
}

.link-primary {
    color: var(--school-primary-color, #3b82f6);
}

.link-primary:hover {
    color: var(--school-secondary-color, #2563eb);
}

/* School custom background image support - overrides default */
.school-login-page-container.has-background-image {
    background-image: var(--background-image-url) !important;
}

.school-login-page-container.has-background-image .school-login-card {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Dark theme support */
.school-login-page-container.dark-theme .school-login-card {
    background-color: #1a1a1a;
    color: #ffffff;
}

.school-login-page-container.dark-theme .form-control,
.school-login-page-container.dark-theme .dx-textbox {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #444 !important;
}

.school-login-page-container.dark-theme .school-name {
    color: #ffffff;
}

.school-login-page-container.dark-theme .school-motto {
    color: #b0b0b0;
}

/* Additional school branding styles */
.school-brand-section .school-logo {
    max-height: 60px;
    max-width: 60px;
    object-fit: contain;
}

/* ===== DEVEXTREME OVERRIDES ===== */
/* Ensure DevExtreme controls fit the new design */
.dx-textbox,
.dx-checkbox {
    font-family: 'Lexend', sans-serif;
}

.dx-textbox-label {
    font-weight: 500;
}

.dx-button {
    font-family: 'Lexend', sans-serif;
}

/* Loading spinner in button */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
}