/* Modern Authentication Styles for Identity App */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: white;
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.auth-card-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-200);
}

.auth-card-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.auth-card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

.auth-card-body {
    padding: 2rem;
}

/* Form Elements */
.auth-form-group {
    margin-bottom: 1.5rem;
}

.auth-form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.auth-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-form-input.error {
    border-color: var(--danger-color);
}

.auth-form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-form-error {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

.auth-form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.auth-btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.auth-btn-secondary {
    background-color: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.auth-btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-50);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn-loading {
    position: relative;
}

.auth-btn-loading .auth-btn-text {
    opacity: 0;
}

.auth-btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* OAuth Button */
.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--gray-700);
}

.auth-google-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.auth-google-btn img {
    width: 20px;
    height: 20px;
}

.auth-apple-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #000000;
    border: 1px solid #000000;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: white;
    margin-top: 0.75rem;
}

.auth-apple-btn:hover {
    background: #333333;
    border-color: #333333;
}

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

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

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

.auth-divider::before {
    margin-right: 1rem;
}

.auth-divider::after {
    margin-left: 1rem;
}

/* Alerts */
.auth-alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.auth-alert-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.auth-alert-content {
    flex: 1;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.auth-alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Links */
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Magic Link Hint */
.magic-link-hint {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Footer Links */
.auth-footer {
    text-align: center;
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* MFA Code Input */
.mfa-code-input {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.mfa-code-digit {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.mfa-code-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Remember Device Checkbox */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.auth-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.auth-checkbox-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}

/* QR Code Container */
.qr-code-container {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.qr-code-container img {
    max-width: 200px;
    margin: 0 auto;
}

/* Backup Codes */
.backup-codes {
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.backup-code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    padding: 0.5rem;
    background: white;
    border-radius: 0.25rem;
    margin: 0.25rem 0;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        border-radius: 0.75rem;
    }
    
    .auth-card-header {
        padding: 1.5rem;
    }
    
    .auth-card-body {
        padding: 1.5rem;
    }
    
    .auth-card-title {
        font-size: 1.5rem;
    }
    
    .mfa-code-digit {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

