/* CSS Custom Properties for Theming */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: var(--primary-color);
    --error-color: var(--primary-color);
    --warning-color: var(--primary-color);
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --border-color: #e5e7eb;
    --border-focus: var(--primary-color);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
}

/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Background Pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle at 25% 25%, white 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, white 2px, transparent 2px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Main Application Box */
.apply_box {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.apply_box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
}

/* Header Section */
.header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    position: relative;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
    transition: transform var(--transition-normal);
}

.header-icon:hover {
    transform: translateY(-2px);
}

.header-icon i {
    color: white;
    font-size: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.title_small {
    font-size: 1.5rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Form Styles */
.application-form {
    padding: 2rem;
}

.form_container {
    display: grid;
    gap: 1.5rem;
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-tertiary);
    grid-column: 1 / -1;
}

.section-title:first-child {
    margin-top: 0;
}

.section-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Form Controls */
.form_control, .textarea_control, .file_control {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Two-column layout for smaller form controls */
@media (min-width: 640px) {
    .form_container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title,
    .textarea_control,
    .file_control {
        grid-column: 1 / -1;
    }
}

/* Labels */
label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

label i {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

/* Input Styling */
input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    position: relative;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input:hover, select:hover, textarea:hover {
    border-color: var(--primary-color);
}

/* Input Border Animation */
.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

input:focus + .input-border,
select:focus + .input-border,
textarea:focus + .input-border {
    transform: scaleX(1);
}

/* Placeholder Styling */
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

input:focus::placeholder, textarea:focus::placeholder {
    color: transparent;
}

/* Select Dropdown */
select {
    appearance: none;
    background-image: none;
    cursor: pointer;
    padding-right: 3rem;
}

.form_control {
    position: relative;
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

select:focus + .input-border + .select-arrow {
    color: var(--primary-color);
    transform: translateY(-50%) rotate(180deg);
}

/* Textarea */
textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* File Upload */
.file_control {
    position: relative;
}

.file-input-wrapper {
    position: relative;
    cursor: pointer;
}

input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    transition: all var(--transition-normal);
    min-height: 120px;
}

.file-input-display:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateY(-2px);
}

.file-input-display i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.file-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.file-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* CSS-only Validation Styles */
input:valid, select:valid, textarea:valid {
    border-color: var(--border-color);
}

input:invalid, select:invalid, textarea:invalid {
    border-color: var(--border-color);
}

input:invalid:focus, select:invalid:focus, textarea:invalid:focus {
    border-color: var(--primary-color);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Button Container */
.button_container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* Button Shine Effect */
.btn-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg) translateX(-200%);
    transition: transform 0.6s;
}

.submit-btn:hover .btn-shine {
    transform: rotate(45deg) translateX(200%);
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .apply_box {
        margin: 0;
        border-radius: var(--radius-lg);
    }
    
    .header {
        padding: 2rem 1rem 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .title_small {
        font-size: 1.2rem;
    }
    
    .application-form {
        padding: 1.5rem;
    }
    
    .form_container {
        gap: 1rem;
    }
    
    .submit-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .header {
        padding: 1.5rem 1rem;
    }
    
    .application-form {
        padding: 1rem;
    }
    
    input, select, textarea {
        padding: 0.625rem 0.875rem;
    }
    
    .file-input-display {
        padding: 1.5rem;
        min-height: 100px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .background-pattern {
        display: none;
    }
    
    .apply_box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .submit-btn {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
        --text-muted: #333;
    }
    
    input, select, textarea {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .background-pattern {
        animation: none;
    }
}

/* Focus Visible for Accessibility */
input:focus-visible, 
select:focus-visible, 
textarea:focus-visible, 
button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}