/* =================================================================
   AUTH-SPA.CSS - Authentication Styles for GateChecks SPA
   =================================================================
   Merged from auth-spa.css and auth-spa-override.css
   Contains: Login, Signup, Forgot Password, MFA styles
   ================================================================= */

/* =================================================================
   BASE LAYOUT & CONTAINERS
   ================================================================= */

/* Ensure full height for auth pages */
html, body {
    height: 100% !important;
    overflow: hidden !important;
}

body {
    background-color: #1a1f2e !important; /* Original darker blue-gray */
}

/* Override CSS variables for consistency */
* {
    --color-primary: #00BCD4 !important;
    --color-primary-hover: #00ACC1 !important;
    --bg-primary: #1a1f2e !important;
    --bg-secondary: #232937 !important;
    --bg-tertiary: #334155 !important;
    --text-primary: #ffffff !important;
    --text-secondary: #8892a0 !important;
}

/* App container overrides */
#app {
    min-height: 100vh !important;
    height: 100vh !important;
    position: relative !important;
}

.view-container {
    min-height: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
}

/* Ensure active view containers are visible */
.view-container.active {
    opacity: 1 !important;
    z-index: 10 !important;
}

/* Auth wrapper - main container */
.auth-wrapper {
    background-color: #1a1f2e !important;
    padding: 20px 20px 20px 20px !important;
    min-height: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: auto !important;
}

/* Auth container */
.auth-container {
    width: 100% !important;
    max-width: 550px !important;
}

/* Signup container - slightly wider */
.signup-container {
    max-width: 550px !important;
}

/* =================================================================
   LOGO STYLING
   ================================================================= */

.logo-container {
    text-align: center !important;
    margin-top: 20px;
    margin-bottom: 2rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.logo-container img {
    display: block !important;
}

.logo-container img.logo {
    width: 100px !important;
    height: 100px !important;
}

.logo-container img.logo-text {
    height: 35px !important;
    width: auto !important;
}

/* =================================================================
   AUTH CARD & CONTENT
   ================================================================= */

.auth-card {
    background-color: #232937 !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    max-width: 550px !important;
    width: 100% !important;
    color: #ffffff !important;
}

/* Titles */
.auth-title {
    font-size: 26px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    color: #ffffff !important;
    margin-bottom: 0.5rem !important;
    text-align: center !important;
}

.signup-title {
    font-size: 28px !important;
}

.auth-subtitle {
    color: #8892a0 !important;
    font-size: 16px !important;
    text-align: center !important;
    margin-bottom: 1.5rem !important;
}

/* =================================================================
   FORM ELEMENTS
   ================================================================= */

.auth-form {
    gap: 0.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 1rem !important;
}

/* Form groups */
.form-group,
.input-group {
    margin-bottom: 1rem !important;
}

/* Form row for two-column layout */
.form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    margin-bottom: 0.5rem !important;
}

/* Labels */
.form-label,
.input-group label,
.form-group label {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Input fields */
.form-input,
.input-group input,
.form-group input {
    background: #2d3442 !important;
    border: 1px solid #3a4050 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
}

.form-input:focus,
.input-group input:focus,
.form-group input:focus {
    border-color: #4EB3D3 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(78, 179, 211, 0.1) !important;
}

.form-input::placeholder,
.input-group input::placeholder,
.form-group input::placeholder {
    color: #5a6271 !important;
}

/* =================================================================
   BUTTONS
   ================================================================= */

/* Primary button */
.btn-primary,
.submit-button {
    background-color: #00BCD4 !important;
    color: #ffffff !important;
    padding: 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-primary:hover:not(:disabled),
.submit-button:hover:not(:disabled) {
    background-color: #00ACC1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.3) !important;
}

.btn-primary:disabled,
.submit-button:disabled {
    background-color: #4a5568 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.7 !important;
}

/* Secondary button */
.btn-secondary {
    background: #334155 !important;
    color: #ffffff !important;
    padding: 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
}

.btn-secondary:hover {
    background: #475569 !important;
}

/* Full width buttons */
.btn-full {
    width: 100% !important;
}

/* Button spacing */
.btn + .btn {
    margin-top: 0.5rem !important;
}

/* =================================================================
   LINKS
   ================================================================= */

/* Primary links */
.link-primary,
.auth-footer a,
.signup-link {
    color: #00BCD4 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.3s ease !important;
}

.link-primary:hover,
.auth-footer a:hover,
.signup-link:hover {
    color: #4EB3D3 !important;
    text-decoration: underline !important;
}

/* Secondary links */
.link-secondary,
.form-footer a {
    color: #00BCD4 !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    transition: all 0.3s ease !important;
}

.link-secondary:hover,
.form-footer a:hover {
    color: #4EB3D3 !important;
    text-decoration: underline !important;
}

/* Back link */
.back-link {
    color: #00BCD4 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    display: inline-block !important;
    margin-top: 1rem !important;
    transition: all 0.3s ease !important;
}

.back-link:hover {
    color: #4EB3D3 !important;
    text-decoration: underline !important;
}

/* =================================================================
   FORM SECTIONS
   ================================================================= */

/* Form footer (for links below form) */
.form-footer {
    text-align: center !important;
    margin-top: 1rem !important;
}

/* Specific styling for forgot password form footer */
#forgotForm .form-footer {
    order: unset !important;
    margin-top: 1.5rem !important;
}

/* Auth footer (bottom of card) */
.auth-footer {
    text-align: center !important;
    margin-top: 2rem !important;
    color: #8892a0 !important;
    font-size: 14px !important;
}

/* Auth links section */
.auth-links {
    text-align: center !important;
    margin-top: 1.5rem !important;
}

.signup-prompt {
    margin-top: 1rem !important;
    font-size: 12px !important;
    color: #8892a0 !important;
}

/* Form divider */
.form-divider {
    color: #8892a0 !important;
    text-align: center !important;
    margin: 1.5rem 0 !important;
    position: relative !important;
}

.form-divider::before,
.form-divider::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    width: 45% !important;
    height: 1px !important;
    background-color: #3a4050 !important;
}

.form-divider::before {
    left: 0 !important;
}

.form-divider::after {
    right: 0 !important;
}

/* =================================================================
   MFA SPECIFIC STYLES
   ================================================================= */

/* MFA icon */
.mfa-icon {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 1.5rem !important;
    color: #00BCD4 !important;
}

/* MFA code input */
.mfa-code-input {
    font-size: 1.5rem !important;
    text-align: center !important;
    letter-spacing: 0.5em !important;
    font-family: monospace !important;
    padding: 1rem !important;
    background-color: #2d3442 !important;
    border: 2px solid #3a4050 !important;
    color: #ffffff !important;
    width: 100% !important;
}

.mfa-code-input:focus {
    border-color: #4EB3D3 !important;
    box-shadow: 0 0 0 3px rgba(78, 179, 211, 0.1) !important;
}

/* MFA options */
.mfa-options {
    gap: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
}

.mfa-option {
    background-color: #2d3442 !important;
    border: 1px solid #3a4050 !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.mfa-option:hover {
    background-color: #334155 !important;
    border-color: #4EB3D3 !important;
}

.mfa-option.selected {
    background-color: #334155 !important;
    border-color: #00BCD4 !important;
}

/* OTP inputs */
.otp-inputs {
    gap: 12px !important;
    display: flex !important;
    justify-content: center !important;
}

.otp-inputs input {
    background-color: #2d3442 !important;
    border: 2px solid #3a4050 !important;
    color: #ffffff !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    text-align: center !important;
    border-radius: 8px !important;
}

.otp-inputs input:focus {
    border-color: #4EB3D3 !important;
    box-shadow: 0 0 0 3px rgba(78, 179, 211, 0.1) !important;
}

/* =================================================================
   MESSAGES & FEEDBACK
   ================================================================= */

/* Error messages */
.error-message {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    padding: 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    margin-bottom: 1rem !important;
}

/* Success messages */
.success-message {
    background-color: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    color: #22c55e !important;
    padding: 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    margin-bottom: 1rem !important;
}

.success-message strong {
    color: #22c55e !important;
    font-weight: 600 !important;
}

.success-message small {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    display: block !important;
    margin-top: 0.5rem !important;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* =================================================================
   LOADING & SPINNER
   ================================================================= */

.spinner {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: #ffffff !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
}

.spinner.hidden {
    display: none !important;
}

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

/* =================================================================
   RESPONSIVE STYLES
   ================================================================= */

/* Mobile (max-width: 640px) */
@media (max-width: 640px) {
    body {
        padding: 0px !important;
        min-height: 100vh !important;
        align-items: flex-start !important;
    }
    
    .auth-wrapper {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        padding: 20px !important;
        padding-top: 0px !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
    
    .logo-container .logo {
        width: 100px !important;
        height: 100px !important;
    }
    
    .auth-card {
        padding: 30px 20px !important;
        margin-top: 20px !important;
    }
    
    .logo-container img.logo-text {
        height: 35px !important;
    }
    
    .auth-subtitle {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }
    
    .form-group,
    .input-group {
        margin-bottom: 16px !important;
    }
    
    .form-label,
    .input-group label,
    .form-group label {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }
    
    .form-input,
    .input-group input,
    .form-group input {
        padding: 10px 12px !important;
        font-size: 15px !important;
    }
    
    .btn-primary {
        padding: 12px !important;
        font-size: 15px !important;
    }
    
    .auth-footer {
        font-size: 13px !important;
        margin-top: 20px !important;
    }
    
    .error-message, 
    .success-message {
        font-size: 13px !important;
        padding: 10px !important;
    }
    
    .signup-title {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }
    
    .signup-prompt {
        font-size: 13px !important;
        margin-top: 20px !important;
    }
}

/* Extra small devices (max-width: 480px) */
@media (max-width: 480px) {
    .auth-title {
        font-size: 24px !important;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .signup-container {
        max-width: 400px !important;
    }
}

/* Extra small devices (max-width: 375px) */
@media (max-width: 375px) {
    .logo-container .logo {
        width: 80px !important;
        height: 80px !important;
    }
    
    .auth-card {
        padding: 25px 15px !important;
    }
    
    .logo-container img.logo-text {
        height: 30px !important;
    }
    
    .signup-title {
        font-size: 20px !important;
    }
}