/*
 * Devicel Auth Stylesheet
 * Login, Register, Password Reset
 * Version: 1.0.0
 */

/* ========================================
   Auth Page Layout
   ======================================== */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) var(--space-5);
    background: var(--bg-light);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

/* ========================================
   Auth Card
   ======================================== */
.auth-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-md);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo {
    margin-bottom: var(--space-6);
}

.auth-logo img {
    height: 40px;
    margin: 0 auto;
}

.auth-header h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-2);
}

.auth-header p {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin: 0;
}

/* ========================================
   Auth Form
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.auth-form .form-group {
    margin-bottom: 0;
}

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

.password-input-wrapper input {
    padding-right: var(--space-12);
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Remember Me & Forgot Password Row */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
}

.auth-options .form-check {
    margin: 0;
}

.auth-options .form-check-label {
    font-size: var(--font-size-sm);
}

.forgot-link {
    color: var(--primary);
    font-weight: var(--font-medium);
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Submit Button */
.auth-submit {
    margin-top: var(--space-2);
}

.auth-submit .btn {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--font-size-lg);
}

/* ========================================
   Social Login
   ======================================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.social-buttons {
    display: flex;
    gap: var(--space-3);
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.social-btn:hover {
    border-color: var(--border-dark);
    background: var(--bg-light);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   Auth Footer
   ======================================== */
.auth-footer {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: var(--font-semibold);
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ========================================
   Auth Alerts
   ======================================== */
.auth-alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-5);
}

.auth-alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-alert-error {
    background: var(--error-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-info {
    background: var(--info-light);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ========================================
   Password Strength
   ======================================== */
.password-strength {
    margin-top: var(--space-2);
}

.strength-bar {
    height: 4px;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.strength-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background var(--transition-base);
}

.strength-bar-fill.weak {
    width: 25%;
    background: var(--error);
}

.strength-bar-fill.fair {
    width: 50%;
    background: var(--warning);
}

.strength-bar-fill.good {
    width: 75%;
    background: var(--info);
}

.strength-bar-fill.strong {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ========================================
   Terms Checkbox
   ======================================== */
.terms-check {
    font-size: var(--font-size-sm);
}

.terms-check a {
    color: var(--primary);
}

.terms-check a:hover {
    text-decoration: underline;
}

/* ========================================
   Password Reset Success
   ======================================== */
.auth-success {
    text-align: center;
    padding: var(--space-6) 0;
}

.auth-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: var(--success-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--success);
}

.auth-success h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-3);
}

.auth-success p {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

/* ========================================
   Two Factor Auth
   ======================================== */
.two-factor-inputs {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin: var(--space-6) 0;
}

.two-factor-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-bold);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.two-factor-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.resend-code {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.resend-code button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: var(--font-medium);
    cursor: pointer;
}

.resend-code button:hover {
    text-decoration: underline;
}

.resend-code button:disabled {
    color: var(--text-light);
    cursor: not-allowed;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
    .auth-card {
        padding: var(--space-6);
    }
    
    .auth-header h1 {
        font-size: var(--font-size-2xl);
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .auth-options {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }
    
    .two-factor-input {
        width: 42px;
        height: 48px;
        font-size: var(--font-size-xl);
    }
}
