/* Copyright © 2026 EntireSoftwareLabs — entiresoftwarelabs.com — All rights reserved. */
/* Application Form Page Styles */
.application { background: var(--gray-100); }

.application-form-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.application-form { display: flex; flex-direction: column; }

.form-group { margin-bottom: var(--spacing-md); }

.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-primary); font-size: 1rem; }

.form-group label .char-limit { display: inline-block; margin-left: 0.5rem; font-size: 0.75rem; font-weight: 400; color: var(--text-secondary); background: var(--gray-100); padding: 0.25rem 0.5rem; border-radius: 0.25rem; }

.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.875rem; border: 2px solid var(--gray-200); border-radius: 0.5rem; font-family: inherit; font-size: 1rem; transition: var(--transition-fast); }

/* Mobile-friendly select: let the native picker render without interference */
.form-group select {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: var(--primary-light); background-color: rgba(99, 102, 241, 0.02); }

.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); background-color: rgba(99, 102, 241, 0.01); }

.file-upload-wrapper { display: flex; flex-direction: column; gap: 0.5rem; }

.file-upload-wrapper input[type="file"] { padding: 1rem; border: 2px dashed var(--primary-color); border-radius: 0.5rem; background-color: rgba(99, 102, 241, 0.05); cursor: pointer; transition: var(--transition-fast); color: var(--text-primary); font-size: 0.95rem; }

.file-upload-wrapper input[type="file"]:hover { background-color: rgba(99, 102, 241, 0.1); }

.file-upload-wrapper input[type="file"]::file-selector-button { 
    padding: 0.5rem 1rem; 
    margin-right: 1rem; 
    border: 1px solid var(--primary-color); 
    border-radius: 0.375rem; 
    background-color: var(--primary-color); 
    color: white; 
    cursor: pointer; 
    font-weight: 500; 
    transition: var(--transition-fast); 
}

.file-upload-wrapper input[type="file"]::file-selector-button:hover { 
    background-color: var(--primary-dark); 
}

.file-info { font-size: 0.85rem; color: var(--text-secondary); font-style: italic; }

/* Form Status Messages */
.form-status { 
    margin-bottom: var(--spacing-md); 
    padding: 1.25rem 1rem; 
    border-radius: 0.5rem; 
    display: none; 
    font-weight: 700; 
    font-size: 1.05rem; 
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.form-status.show { display: block; }
.form-status.success { 
    background-color: #d1fae5; 
    border: 2px solid #10b981;
    border-left: 6px solid #10b981; 
    color: #065f46;
}
.form-status.error { 
    background-color: #fee2e2; 
    border: 2px solid #ef4444;
    border-left: 6px solid #ef4444; 
    color: #991b1b;
}
.form-status.warning { 
    background-color: #fef3c7; 
    border: 2px solid #f59e0b;
    border-left: 6px solid #f59e0b; 
    color: #92400e;
}

@keyframes slideDown { 
    from { opacity: 0; transform: translateY(-10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.file-name { font-size: 0.9rem; color: var(--primary-color); font-weight: 500; display: none; }

.file-name.show { display: block; }

/* Phone row injected by seg_countrycode.js */
.phone-row { display:flex; gap:0.5rem; align-items:stretch; width:100%; }
.phone-row .country-code-select { 
    /* Desktop: give more space so selected country names are visible - using !important to override .form-group select */
    flex: 0 0 200px !important;
    min-width: 160px !important;
    max-width: 280px !important;
    width: auto !important;
    padding:0.875rem 0.5rem; 
    border:2px solid var(--gray-200); 
    border-radius:0.5rem; 
    background:var(--white);
    font-family:inherit;
    font-size:0.95rem;
    transition:var(--transition-fast);
}
.phone-row .phone-input { 
    flex:1; 
    min-width:0;
    padding:0.875rem; 
    border:2px solid var(--gray-200); 
    border-radius:0.5rem;
    font-family:inherit;
    font-size:1rem;
    transition:var(--transition-fast);
}
.phone-row .country-code-select:hover, .phone-row .phone-input:hover { 
    border-color:var(--primary-light); 
    background-color:rgba(99,102,241,0.02); 
}
.phone-row .country-code-select:focus, .phone-row .phone-input:focus { 
    outline:none; 
    border-color:var(--primary-color); 
    box-shadow:0 0 0 3px rgba(37,99,235,0.1);
    background-color:rgba(99,102,241,0.01);
}

.form-group-privacy { display: flex; align-items: center; margin: var(--spacing-lg) 0; }

.privacy-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.95rem; color: var(--text-primary); font-weight: 500; }

.privacy-label input[type="checkbox"] { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; cursor: pointer; }

.privacy-label a { color: var(--primary-color); text-decoration: none; transition: color var(--transition-fast); }

.privacy-label a:hover { color: var(--primary-dark); text-decoration: underline; }

.application-form .btn { width: 100%; margin-top: var(--spacing-md); padding: 0.875rem; font-size: 1rem; }

/* Error States */
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important; }

.form-error { color: #ef4444; font-size: 0.85rem; margin-top: 0.25rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .application-form-container { padding: var(--spacing-md); }
    .form-group label { font-size: 0.95rem; }
    .application-form .btn { padding: 0.75rem; font-size: 0.95rem; }
    
    /* Mobile override: keep country select compact on small screens */
    .phone-row .country-code-select { 
        flex: 0 0 110px !important; 
        min-width: 90px !important; 
        max-width: 140px !important;
    }
    
    .form-group select {
        transition: none !important;
    }
}

@media (max-width: 480px) {
    .application-form-container { padding: 1rem; }
    .form-group { margin-bottom: 1rem; }
    .file-upload-wrapper input[type="file"] { padding: 0.75rem; }
}

/* Dark mode - comprehensive form visibility improvements */
html[data-theme="dark"] .application {
    background: var(--dark-bg);
}

html[data-theme="dark"] .application-form-container {
    background: var(--dark-secondary);
    border: 1px solid rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .form-group label {
    color: var(--text-primary);
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .phone-row .country-code-select,
html[data-theme="dark"] .phone-row .phone-input {
    background: var(--dark-tertiary);
    color: var(--text-primary);
    border: 2px solid rgba(139, 92, 246, 0.2);
}

html[data-theme="dark"] .form-group input::placeholder,
html[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

html[data-theme="dark"] .form-group input:hover,
html[data-theme="dark"] .form-group textarea:hover,
html[data-theme="dark"] .form-group select:hover,
html[data-theme="dark"] .phone-row .country-code-select:hover,
html[data-theme="dark"] .phone-row .phone-input:hover {
    background: var(--dark-secondary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus,
html[data-theme="dark"] .form-group select:focus,
html[data-theme="dark"] .phone-row .country-code-select:focus,
html[data-theme="dark"] .phone-row .phone-input:focus {
    outline: none;
    background: var(--dark-secondary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    color: var(--text-primary);
}

/* Ensure dropdown options are visible */
html[data-theme="dark"] .form-group select option,
html[data-theme="dark"] .phone-row .country-code-select option {
    background: var(--dark-secondary);
    color: var(--text-primary);
}

/* File upload in dark mode */
html[data-theme="dark"] .file-upload-wrapper input[type="file"] {
    background: var(--dark-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

html[data-theme="dark"] .file-upload-wrapper input[type="file"]:hover {
    background: var(--dark-secondary);
    border-color: var(--primary-color);
}

html[data-theme="dark"] .file-upload-wrapper input[type="file"]::file-selector-button {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

html[data-theme="dark"] .file-upload-wrapper input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}

html[data-theme="dark"] .file-info {
    color: var(--text-secondary);
}

html[data-theme="dark"] .file-name {
    color: var(--primary-color);
}

/* In dark mode --white becomes #0B1220 (dark), so the section header text
   set by style.css "white text for dark-bg sections" rule becomes invisible.
   Override with actual light colors. Force with !important to win cascade. */
html[data-theme="dark"] .application .section-title {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .application .section-subtitle {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .privacy-label {
    color: var(--text-primary);
}

html[data-theme="dark"] .privacy-label a {
    color: var(--primary-color);
}

html[data-theme="dark"] .privacy-label a:hover {
    color: var(--primary-light);
}

/* Error states in dark mode */
html[data-theme="dark"] .input-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

html[data-theme="dark"] .form-error {
    color: #fca5a5;
}
