/* ============================================
   COMPONENTS.css - Buttons, Cards, Modals, Forms, Inputs
   ============================================
   Contains:
   - Card components
   - Buttons (primary, success, outline, danger)
   - Status messages
   - OCR Status
   - Modal overlays
   - Social buttons
   - Password field
   - Auth modal (premium design)
   - Form elements
   - Upload area
   - Field list
   - Extracted list
   ============================================ */

.card { background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-title { font-size: 1rem; font-weight: 600; color: #374151; margin-bottom: 1rem; }

/* Upload */
.upload-area { border: 2px dashed #7c3aed; border-radius: 12px; padding: 1.5rem 1rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-area:hover { background: #f5f3ff; }
.upload-area.disabled { opacity: 0.5; cursor: not-allowed; }
.upload-area.dragover { background: #f5f3ff; border-color: #7c3aed; }
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-input { display: none; }

/* Fields */
.field-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.field-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: #f9fafb; border-radius: 6px; border: 2px solid transparent; }
.field-item.selected { border-color: #7c3aed; background: #f5f3ff; }
.field-item input[type="radio"] { accent-color: #7c3aed; }
.field-item label { flex: 1; font-size: 0.875rem; cursor: pointer; }
.delete-btn { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 0.8rem; }
.delete-btn:hover { color: #ef4444; }

.add-field { display: flex; gap: 0.5rem; margin-top: 1rem; }
.add-field input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.875rem; }
.add-field input:focus { outline: none; border-color: #7c3aed; }

/* Extracted List */
.extracted-list { margin-top: 1rem; max-height: 150px; overflow-y: auto; }
.extracted-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: #f5f3ff; border-radius: 6px; margin-bottom: 0.5rem; font-size: 0.75rem; }
.field-name { font-weight: 600; color: #7c3aed; }
.field-value { flex: 1; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 500; font-size: 0.875rem; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: #7c3aed; color: white; }
.btn-primary:hover { background: #6d28d9; }
.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; transform: translateY(-2px); }
.btn-success:enabled { animation: glow 2s infinite; }
.btn-outline { background: white; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { background: #f9fafb; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

@keyframes glow { 
    0%, 100% { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4); } 
    50% { box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6); }
}

/* Status */
.status { display: none; padding: 1rem; border-radius: 8px; font-size: 0.875rem; margin-top: 0.75rem; }
.status.success { display: block; background: #d1fae5; color: #065f46; }
.status.error { display: block; background: #fee2e2; color: #991b1b; }

/* OCR Status */
.ocr-status { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 6px; padding: 0.75rem; margin-bottom: 1rem; font-size: 0.875rem; color: #92400e; display: none; }
.ocr-status.active { display: block; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 16px; padding: 2rem; max-width: 500px; width: 90%; }
.modal h2 { margin-bottom: 1.5rem; text-align: center; }

/* Social Buttons */
.social-btn { width: 100%; padding: 0.75rem; border-radius: 8px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 0.75rem; transition: all 0.2s; }
.social-btn.google { background: white; border: 1px solid #d1d5db; color: #374151; }
.social-btn.google:hover { background: #f9fafb; }
.social-btn.apple { background: #000; border: none; color: white; }
.social-btn.apple:hover { background: #333; }
.divider { display: flex; align-items: center; margin: 1rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid #e5e7eb; }
.divider span { padding: 0 1rem; color: #9ca3af; font-size: 0.875rem; }

/* Password field */
.password-field { position: relative; }
.password-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #9ca3af; padding: 0.25rem; }
.password-toggle:hover { color: #6b7280; }

/* ============================================
   AUTH MODAL - Premium Design
   ============================================ */

.auth-modal-container {
    display: flex;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: authModalSlideIn 0.3s ease-out;
}

@keyframes authModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Left Side - Branding */
.auth-modal-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
    padding: 2.5rem;
    width: 380px;
    position: relative;
    overflow: hidden;
}

.auth-branding-content {
    position: relative;
    z-index: 2;
}

.auth-branding-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-branding-title {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-branding-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(255,255,255,0.1);
    padding: 0.875rem 1rem;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.2s;
}

.auth-feature-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(5px);
}

.auth-feature-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.auth-feature-title {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-feature-desc {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.auth-branding-decoration {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Right Side - Form */
.auth-modal-form-side {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    position: relative;
}

.auth-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Mobile close button - larger touch target */
@media (max-width: 768px) {
    .auth-close-btn {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        top: 0.75rem;
        right: 0.75rem;
        z-index: 10;
    }
}

.auth-form-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form-header h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-form-header p {
    color: #6b7280;
    font-size: 0.9rem;
}

.auth-error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-error-message::before {
    content: "⚠️";
}

/* Input Groups */
.auth-input-group {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.auth-label-icon {
    font-size: 1rem;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #fafafa;
}

.auth-input:focus {
    outline: none;
    border-color: #7c3aed;
    background: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input-with-toggle {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0.25rem;
    transition: color 0.2s;
}

.auth-password-toggle:hover {
    color: #7c3aed;
}

.auth-password-hint {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.auth-password-hint span {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Remember Me Checkbox */
.auth-remember-me {
    margin-bottom: 1.25rem;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.auth-checkbox {
    display: none;
}

.auth-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.auth-checkbox:checked + .auth-checkbox-custom {
    background: #7c3aed;
    border-color: #7c3aed;
}

.auth-checkbox:checked + .auth-checkbox-custom::after {
    content: "✓";
    color: white;
    font-size: 0.75rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Forgot Link */
.auth-forgot-link {
    text-align: right;
    margin-bottom: 1rem;
}

.auth-forgot-link button {
    background: none;
    border: none;
    color: #7c3aed;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-forgot-link button:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

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

.auth-submit-icon {
    font-size: 1.1rem;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Social Buttons */
.auth-social-buttons {
    display: flex;
    gap: 0.75rem;
}

.auth-social-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.auth-google-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
}

.auth-google-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.auth-apple-btn {
    background: #000;
    border: 2px solid #000;
    color: white;
}

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

/* Switch Text */
.auth-switch-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.auth-switch-text button {
    background: none;
    border: none;
    color: #7c3aed;
    cursor: pointer;
    font-weight: 600;
    margin-left: 0.25rem;
    transition: color 0.2s;
}

.auth-switch-text button:hover {
    color: #5b21b6;
    text-decoration: underline;
}

/* Auth Modal Responsive */
@media (max-width: 768px) {
    .auth-modal-container {
        flex-direction: column;
        max-width: 450px;
    }
    
    .auth-modal-branding {
        display: none;
    }
    
    .auth-modal-form-side {
        padding: 1.5rem;
    }
    
    .auth-form-header h2 {
        font-size: 1.25rem;
    }
    
    .auth-social-buttons {
        flex-direction: column;
    }
}

/* Responsive */
@media (max-width: 1100px) {
    .main-layout { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .main-layout { grid-template-columns: 1fr; }
    .container { padding: 1rem; }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .intro-section { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
    .steps-grid { grid-template-columns: 1fr; }
}
