/* ========================================
   AdminLTE-Style Login Page CSS - Mobile First
   ======================================== */

/* CSS Variables for AdminLTE theming */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --primary-light: #cfe2ff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --text-dark: #212529;
    --text-medium: #6c757d;
    --text-light: #adb5bd;
    --border-color: #dee2e6;
    --bg-light: #f4f6f9;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.25rem;
    --radius-md: 0.25rem;
    --radius-lg: 0.25rem;
    --radius-xl: 0.25rem;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body.modern-login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Remove animated background elements for AdminLTE style */
body.modern-login-page::before,
body.modern-login-page::after {
    display: none;
}

/* Main container */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Brand section */
.login-brand {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.brand-logo-circle {
    width: 70px;
    height: 70px;
    background: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.brand-logo-circle i {
    font-size: 2rem;
    color: var(--primary-color);
}

.brand-name {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0.5rem 0 0.25rem;
    text-shadow: none;
}

.brand-tagline {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin: 0;
}

/* Login card */
.modern-login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card header */
.login-card-header {
    background: var(--white);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.login-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-icon i {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-dark);
}

.login-subtitle {
    font-size: 0.95rem;
    margin: 0;
    color: var(--text-medium);
}

/* Card body */
.login-card-body {
    padding: 2rem 1.5rem;
}

/* Modern form group */
.form-group-modern {
    margin-bottom: 1.5rem;
}

.form-label-modern {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.label-icon {
    margin-right: 0.5rem;
    color: var(--primary-color);
    font-size: 0.875rem;
}

/* Modern input */
.form-control-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    outline: none;
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control-modern::placeholder {
    color: var(--text-light);
}

.form-control-modern.is-invalid {
    border-color: var(--danger-color);
}

.form-control-modern.is-valid {
    border-color: var(--success-color);
}

/* Password input wrapper with toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control-modern {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3rem;
    background: transparent;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    outline: none;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle:focus {
    color: var(--primary-color);
}

/* Form options */
.form-options-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Modern checkbox */
.form-check-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input-modern {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.form-check-input-modern:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input-modern:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-check-label-modern {
    font-size: 0.875rem;
    color: var(--text-medium);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* Link */
.link-modern {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-modern:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.forgot-password-link {
    white-space: nowrap;
}

/* Submit button */
.form-submit-modern {
    margin-bottom: 0;
}

.btn-modern-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.btn-modern-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: none;
}

.btn-modern-primary:active {
    transform: none;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn-modern-primary:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-modern-primary:disabled,
.btn-modern-primary.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-modern-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Card footer */
.login-card-footer {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-medium);
}

.footer-text i {
    color: var(--success-color);
}

/* Login footer */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-footer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin: 0;
}

/* Flash messages styling */
.message {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.message.success {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.message.warning {
    background-color: #ffe;
    border: 1px solid #ffc;
    color: #cc3;
}

.message.info {
    background-color: #eef;
    border: 1px solid #ccf;
    color: #33c;
}

/* Responsive design */
@media (max-width: 576px) {
    .login-container {
        padding: 1rem;
    }

    .login-brand {
        margin-bottom: 1.5rem;
    }

    .brand-logo-circle {
        width: 60px;
        height: 60px;
    }

    .brand-logo-circle i {
        font-size: 1.75rem;
    }

    .brand-name {
        font-size: 1.75rem;
    }

    .brand-tagline {
        font-size: 0.875rem;
    }

    .login-card-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .login-icon {
        width: 50px;
        height: 50px;
    }

    .login-icon i {
        font-size: 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 0.875rem;
    }

    .login-card-body {
        padding: 1.5rem 1.25rem;
    }

    .form-group-modern {
        margin-bottom: 1.25rem;
    }

    .form-control-modern {
        padding: 0.625rem 0.875rem;
        font-size: 0.95rem;
    }

    .password-input-wrapper .form-control-modern {
        padding-right: 2.75rem;
    }

    .password-toggle {
        width: 2.75rem;
    }

    .form-options-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.875rem;
    }

    .btn-modern-primary {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .login-card-footer {
        padding: 0.875rem 1.25rem;
    }

    .footer-text {
        font-size: 0.8125rem;
    }
}

@media (max-width: 375px) {
    .login-container {
        padding: 0.75rem;
    }

    .modern-login-card {
        border-radius: var(--radius-lg);
    }

    .login-card-body {
        padding: 1.25rem 1rem;
    }

    .login-card-header {
        padding: 1.25rem 1rem 1rem;
    }
}

/* Print styles */
@media print {
    body.modern-login-page {
        background: var(--white);
    }

    body.modern-login-page::before,
    body.modern-login-page::after {
        display: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .form-control-modern {
        border-width: 2px;
    }

    .btn-modern-primary {
        border: 2px solid var(--primary-hover);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   Passkey Login Styles
   ======================================== */

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.login-divider span {
    padding: 0 1rem;
    color: var(--text-medium);
    font-size: 0.875rem;
    font-weight: 500;
}

.passkey-section {
    margin-top: 1.5rem;
}

.passkey-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.passkey-title i {
    color: var(--info-color);
}

.btn-passkey {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-passkey:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.btn-passkey:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-passkey i {
    font-size: 1.25rem;
}

.btn-passkey.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-passkey.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

.passkey-info {
    font-size: 0.8125rem;
    color: var(--text-medium);
    text-align: center;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
}

.passkey-info i {
    color: var(--info-color);
    margin-right: 0.25rem;
}

/* Passkey error/success messages */
.passkey-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    animation: slideDown 0.3s ease-out;
}

.passkey-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.passkey-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Mobile adjustments for passkey section */
@media (max-width: 576px) {
    .login-divider {
        margin: 1.25rem 0;
    }

    .passkey-section {
        margin-top: 1.25rem;
    }

    .btn-passkey {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
}

