/* Page shell */
.login-page-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #f5f9ff 0%, #eef3f8 100%);
    display: flex;
    align-items: center;
}

.login-page-shell > .row {
    width: 100%;
}

/* Login Form Styles */
.login-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 2.5rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.05);
    border: 1px solid rgba(0,0,0,.07);
    transform: translateY(-36px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.login-hero-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    margin: 0 auto .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #e8f1ff 0%, #d7e8ff 100%);
    color: #1f5fd4;
}

.login-hero-icon i {
    font-size: 2rem;
}

.login-help-button {
    padding: .2rem .35rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #4a5b70;
    text-decoration: none;
    font-size: .86rem;
    line-height: 1;
    border: none;
    background: transparent;
}

.login-help-button i {
    font-size: .86rem;
    margin-bottom: 0;
    display: inline-block;
}

.login-help-button:hover,
.login-help-button:focus {
    color: #27486a;
    background: transparent;
    text-decoration: none;
}

.login-provider-primary {
    font-weight: 600;
}

.login-provider-alt {
    border-color: #d7dee8;
    color: #384d63;
    font-weight: 600;
    background: #fff;
}

.login-provider-alt:hover,
.login-provider-alt:focus {
    background: #f7f9fc;
    border-color: #c8d3e2;
    color: #2e4258;
}

.local-login-panel {
    border: 1px solid rgba(0, 0, 0, .11);
    border-radius: 10px;
    background: #fafbfc;
    padding: .55rem .7rem;
}

.local-login-panel summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #495057;
    font-size: .92rem;
}

.local-login-panel summary::-webkit-details-marker {
    display: none;
}

.local-login-panel[open] {
    background: #fff;
    border-color: rgba(0, 0, 0, .15);
}

.local-login-body {
    border-top: 1px dashed rgba(0, 0, 0, .12);
    padding-top: .8rem;
}

.login-header > i {
    font-size: 2.75rem;
    margin-bottom: .75rem;
    display: block;
}

.login-header h3 {
    margin-bottom: 0.375rem;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 1.35rem;
}

.login-header p {
    font-size: .875rem;
}

.form-floating {
    margin-bottom: 1rem;
}

.btn-login {
    width: 100%;
    padding: .7rem 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: .01em;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.15);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading-spinner {
    display: none;
}

.form-control {
    border: 1.5px solid rgba(0,0,0,.13);
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: 1rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(13,110,253,.18);
    background-color: #fff;
}

.form-control[readonly] {
    background-color: #f8f9fa;
    opacity: 0.7;
    cursor: not-allowed;
    border-color: rgba(0,0,0,.1);
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: none;
}

.form-floating > label {
    padding: .75rem 1rem;
    color: #6c757d;
    font-weight: 500;
}

.form-floating > label i {
    margin-right: .5rem;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: .25rem;
    font-size: .8125rem;
    color: #dc3545;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.alert {
    border-radius: 10px;
    border: none;
    border-left: 4px solid currentColor;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background: #fff2f2;
    color: #9b1c1c;
}

.alert i {
    margin-right: .5rem;
}

.loading .form-floating {
    opacity: 0.6;
    transition: opacity .3s ease;
}

/* Login Modal Styles */
#loginModal .modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 16px 40px rgba(0,0,0,.20);
}

#loginModal .modal-header {
    background: linear-gradient(135deg, #cf4b58 0%, #a93e49 100%);
    color: white;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
}

/* Softer typography for login error modal */
#loginModal .modal-title {
    font-size: 1.15rem;
    font-weight: 550;
    letter-spacing: 0.01em;
}

#loginModal .modal-body {
    padding: 1.6rem 1.8rem;
    font-size: 0.98rem;
    line-height: 1.45;
    color: #5f6b76;
}

#loginModal #modal-message {
    font-size: 0.98rem;
    font-weight: 450;
}

#loginModal .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 0.85rem 1.6rem;
}

#loginModal #modalErrorConfirm {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

#loginModal #modalErrorConfirm:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Login help modal styles */
#loginHelpModal .modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 14px 36px rgba(0,0,0,.18);
}

#loginHelpModal .modal-title {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.login-help-list {
    margin: 0 0 .8rem 0;
    padding-left: 1.2rem;
}

.login-help-list li {
    margin-bottom: .45rem;
    color: #495057;
    line-height: 1.35;
}

/* Small text info */
.text-muted small {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: fadeIn 0.5s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 576px) {
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
        max-width: none;
        transform: translateY(-16px);
    }

    .login-hero-icon {
        width: 56px;
        height: 56px;
    }

    .login-hero-icon i {
        font-size: 2.5rem;
    }
    
    .login-header h3 {
        font-size: 1.5rem;
    }
    
    #loginModal .modal-dialog {
        margin: 1rem;
    }

}

/* Focus trap for accessibility */
.login-container:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-login {
        background: #0066cc;
        border: 2px solid #004499;
    }
    
    .form-control {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn-login,
    .form-control,
    .login-container {
        transition: none;
    }
    
    .loading-spinner i {
        animation: none;
    }
}