/**
 * QS System - Auth Pages Styles (Refined & Centered)
 * 
 * Brand Guidelines:
 * Primary Blue: #016AA7
 * Font: Instrument Sans / Calibri
 */

:root {
    --qs-primary: #016AA7;
    --qs-primary-hover: #005a8f;
    --qs-accent: #D74F29;
    --qs-text: #333333;
    --qs-text-light: #666666;
    --qs-bg-light: #f8fafc;
    --qs-radius: 12px;
}

/* Flexible Auth Wrapper - Displays within normal page flow (fixes menu visibility) */
.qs-auth-premium-wrapper {
    position: relative;
    width: 100%;
    min-height: 90vh; /* Takes most of the viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* Let the site background show if needed, or keep it light */
    font-family: 'Instrument Sans', sans-serif;
    margin: 40px 0; /* Extra spacing for breathing room */
}

/* Background Gradients (Soft QS Brand colors) */
.qs-auth-premium-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(1, 106, 167, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    top: -10%;
    right: -10%;
    z-index: 0;
}

/* The Card */
.qs-auth-container {
    width: 100%;
    max-width: 440px; /* Symmetrical & Elegant width */
    padding: 20px;
    position: relative;
    z-index: 10;
}

.qs-auth-box {
    background: #ffffff;
    border-radius: var(--qs-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    padding: 40px;
    border: 1px solid #f1f5f9;
    text-align: center;
}

/* Logo - Fixed Sizing & Spacing */
.qs-auth-logo {
    margin-bottom: 30px;
}

.qs-auth-logo img {
    max-width: 200px;
    height: auto;
    display: inline-block;
}

/* Headings */
.qs-auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--qs-primary);
    margin-bottom: 12px;
}

.qs-auth-subtitle {
    font-size: 14px;
    color: var(--qs-text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Form Styling */
.qs-form-group {
    text-align: left;
    margin-bottom: 20px;
}

.qs-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.qs-form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.qs-form-input:focus {
    outline: none;
    border-color: var(--qs-primary);
    box-shadow: 0 0 0 3px rgba(1, 106, 167, 0.1);
}

/* Password Toggle Inner */
.qs-input-wrapper {
    position: relative;
}

.qs-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 45px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.qs-password-toggle:hover {
    color: var(--qs-primary);
}

/* Strength Meter - Clean Design */
.qs-strength-meter {
    margin-top: 10px;
}

.qs-strength-bar {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

#qs-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s ease;
}

#qs-strength-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
}

/* Strength Colors */
.qs-strength-weak { width: 25% !important; background: #ef4444 !important; }
.qs-strength-medium { width: 50% !important; background: #f59e0b !important; }
.qs-strength-strong { width: 75% !important; background: #10b981 !important; }
.qs-strength-secure { width: 100% !important; background: #059669 !important; }

/* Criteria list */
.qs-password-criteria ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qs-password-criteria li {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qs-password-criteria li::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2e8f0;
}

.qs-password-criteria li.crit-valid {
    color: #10b981;
}

.qs-password-criteria li.crit-valid::before {
    background: #10b981;
}

/* Primary Button (The Big One) */
.qs-btn-premium-action {
    background: var(--qs-primary);
    color: #fff;
    padding: 16px 20px;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; /* Centers horizontal (content) */
    text-align: center; /* Extra safety for text centering */
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(1, 106, 167, 0.2);
    margin-top: 20px;
}

.qs-btn-premium-action:hover {
    background: var(--qs-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(1, 106, 167, 0.3);
}

.qs-btn-premium-action:active {
    transform: translateY(0);
}

.qs-btn-premium-action svg {
    transition: transform 0.2s ease;
}

.qs-btn-premium-action:hover svg {
    transform: translateX(4px);
}

/* Error/Success Messages */
.qs-message {
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: left;
}

.qs-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.qs-message-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

/* Spinner */
.qs-loading {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: qs-spin 0.6s linear infinite;
}

@keyframes qs-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .qs-auth-box {
        padding: 30px 20px;
    }
}

/* ==================== MODALS (Terms & Privacy) ==================== */
.qs-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(1, 41, 64, 0.6); /* Brand-tinted deep overlay */
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
}

.qs-modal-content {
    background-color: #ffffff;
    margin: 40px auto;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    animation: qsModalSlideDown 0.3s ease-out;
}

@keyframes qsModalSlideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.qs-modal-close {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #94a3b8;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.qs-modal-close:hover {
    color: var(--qs-accent);
}

/* Modal Content Typography */
.qs-modal-content h2 {
    color: var(--qs-primary);
    font-size: 24px;
    margin-bottom: 25px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
}

.qs-modal-content h3 {
    font-size: 16px;
    color: var(--qs-text);
    margin: 25px 0 10px;
}

.qs-modal-content p {
    font-size: 14px;
    color: var(--qs-text-light);
    line-height: 1.7;
    margin-bottom: 15px;
}

.qs-modal-content strong {
    color: var(--qs-primary);
}