/**
 * File: auth-forms.css
 * Description: Modern authentication forms with blue color scheme
 * Inspired by: Minimal Music Login Form
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Auth container */
.auth-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #1d4ed8);
    border-radius: 16px 16px 0 0;
}

/* Header styles */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 16px;
    color: #64748b;
    font-weight: 400;
}

/* Form styles */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.is-invalid {
    border-color: #ef4444;
}

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

/* Button styles */
.btn-primary {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    color: #64748b;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e5e7eb;
    color: #64748b;
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-outline:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-1px);
}

.btn-copy {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    color: #475569;
    height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.btn-copy:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

.btn-copy:active {
    transform: translateY(0);
}

/* Alert styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #d97706;
}

/* Links */
.auth-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #64748b;
}

/* Footer links */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer a {
    font-size: 14px;
}

/* TOTP specific styles */
.totp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

.totp-code-display {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    word-break: break-all;
}

.setup-steps {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.setup-step {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.setup-step:last-child {
    border-bottom: none;
}

.setup-step strong {
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
}

.setup-step small {
    color: #64748b;
    font-size: 13px;
}

.qr-container {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 24px 0;
}

.qr-container img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
}

/* Method selection cards */
.method-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.method-card {
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.method-card:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.02);
}

.method-card.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.method-card i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #3b82f6;
}

.method-card h6 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.method-card p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Responsive design */
@media (max-width: 480px) {
    .auth-container {
        padding: 24px;
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .method-selector {
        grid-template-columns: 1fr;
    }
}

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

/* Form validation feedback */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 8px;
    font-size: 14px;
    color: #ef4444;
}

.form-input.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-help {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* Auth info section */
.auth-info {
    margin-bottom: 24px;
}

.auth-info .alert {
    margin-bottom: 0;
    text-align: center;
    font-size: 14px;
}

.auth-info small {
    opacity: 0.8;
    font-size: 12px;
}

/* TOTP Instructions */
.totp-instructions {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.instruction-content {
    flex: 1;
}

.instruction-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.instruction-content p {
    font-size: 14px;
    color: #475569;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.security-reminder {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    background: rgba(59, 130, 246, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.security-reminder i {
    color: #3b82f6;
    font-size: 12px;
}

/* Responsive design for TOTP instructions */
@media (max-width: 480px) {
    .totp-instructions {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px;
    }
    
    .instruction-content h3 {
        font-size: 16px;
    }
    
    .security-reminder {
        justify-content: center;
    }
}

/* Utility classes */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

.gap-2 { gap: 8px; }


/* Text color utilities */
.text-success { color: #16a34a !important; }
.text-danger { color: #ef4444 !important; }
.text-warning { color: #d97706 !important; }
.text-info { color: #2563eb !important; }
.text-muted { color: #64748b !important; }
