/* ============================================
   GP REFERRAL PAGE STYLES
   Form-specific styles for the document upload
   ============================================ */

/* ========== Document Upload Section ========== */

.document-upload-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2f7 50%, #f1f5f9 100%);
    padding: 60px 20px;
}

.document-upload-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== Section Header (scoped to upload section) ========== */
.document-upload-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.document-upload-section .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(91, 163, 208, 0.15), rgba(91, 163, 208, 0.08));
    color: var(--primary-dark);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(91, 163, 208, 0.2);
}

.document-upload-section .section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
}

.document-upload-section .section-description {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Messages (stay until refresh) */
.messages-container {
    max-width: 720px;
    margin: 1rem auto 0;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* ========== Form Container ========== */
.upload-form-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Main Form Card ========== */
.upload-form-card {
    background: white;
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.form-header h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.form-header h3 i {
    color: var(--primary-color);
}

.form-header p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ========== Step Labels (scoped to upload form) ========== */
.upload-form .step-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.upload-form .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.upload-form .step-text {
    flex: 1;
}

/* ========== File Upload Zone ========== */
.file-upload-group {
    margin-bottom: 1rem;
}

.file-drop-zone {
    position: relative;
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-2px);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.drop-zone-text strong {
    color: var(--primary-color);
}

.drop-zone-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.selected-files {
    margin-top: 1rem;
    text-align: left;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.file-item i {
    color: var(--primary-color);
}

.file-item .file-name {
    flex: 1;
    color: var(--text-dark);
    font-weight: 500;
}

.file-item .file-size {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ========== Document Type Selection ========== */
.document-type-group {
    margin-bottom: 1rem;
}

.document-type-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.type-option {
    cursor: pointer;
}

.type-option input[type="checkbox"] {
    display: none;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1.25rem 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.type-card i {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.type-option:hover .type-card {
    border-color: var(--primary-light);
    background: #f0f9ff;
    transform: translateY(-2px);
}

.type-option input[type="checkbox"]:checked + .type-card {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    box-shadow: 0 4px 12px rgba(91, 163, 208, 0.2);
}

.type-option input[type="checkbox"]:checked + .type-card i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* ========== Optional Section ========== */
.optional-section {
    margin-bottom: 1rem;
}

.optional-toggle {
    width: 100%;
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.optional-toggle:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.optional-toggle i {
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.optional-toggle.active i {
    transform: rotate(45deg);
}

.optional-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin 0.4s ease;
}

.optional-content.active {
    max-height: 300px;
    margin-top: 1rem;
}

.optional-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.field-group label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.field-group input {
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.field-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 163, 208, 0.1);
}

.optional-note {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== Form Actions ========== */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-submit,
.btn-reset {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1.125rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2d5f85);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 163, 208, 0.3);
}

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

.btn-reset {
    background: white;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    box-shadow: none;
}

.btn-reset:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ========== Info Sidebar ========== */
.upload-info-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 20px;
}

.info-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.info-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.info-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section h4 i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.info-list li i {
    color: var(--success-color);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.help-box {
    background: linear-gradient(135deg, #fef9e7, #fef3c7);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #92400e;
    font-size: 0.875rem;
}

.help-box i {
    color: #d97706;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.help-box strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #78350f;
}

.help-box p {
    margin: 0;
    line-height: 1.5;
}

.help-box a {
    color: #d97706;
    font-weight: 600;
    text-decoration: none;
}

.help-box a:hover {
    text-decoration: underline;
}

/* ========== Mobile Responsive ========== */
@media (max-width: 968px) {
    .upload-form-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .upload-info-card {
        position: static;
        order: -1;
    }
    
    .document-type-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .optional-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .document-upload-section {
        padding: 40px 15px;
    }
    
    .upload-form-card {
        padding: 1.5rem;
    }
    
    .file-drop-zone {
        padding: 2rem 1rem;
    }
    
    .drop-zone-content i {
        font-size: 2.5rem;
    }
    
    .document-type-options {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit,
    .btn-reset {
        width: 100%;
    }
}
