/* ==========================================================================
   Oxygen Advantage Instructor Profile Form Stylesheet
   Modern UI/UX design with responsive Grid CSS layout
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables & Base Styles
   ========================================================================== */

:root {
    /* Oxygen Advantage Brand Colors */
    --primary-color: #ec1a2a;
    --primary-hover: #d41620;
    --primary-light: #fef2f2;
    --secondary-color: #f97316;
    --text-color: #202223;
    --text-subdued: #6d7175;
    --text-disabled: #8c9196;
    
    /* Background Colors */
    --surface-primary: #ffffff;
    --surface-secondary: #f6f6f7;
    --surface-subdued: #f5f5f7;
    --surface-disabled: #f6f6f7;
    
    /* Border Colors */
    --border-color: #d1d5db;
    --border-subdued: #e5e7eb;
    --border-disabled: #e5e7eb;
    --border-focus: var(--primary-color);
    
    /* Interactive Colors */
    --interactive-normal: var(--primary-color);
    --interactive-hover: var(--primary-hover);
    --interactive-disabled: #bec5c9;
    
    /* Status Colors */
    --success-color: #008060;
    --success-bg: #f0f9ff;
    --warning-color: #b91c1c;
    --warning-bg: #fef2f2;
    --info-color: #0284c7;
    --info-bg: #f0f9ff;
    
    /* Footer */
    --footer-bg: #211F44;
    --footer-text: #ffffff;
    
    /* Typography */
    --font-family-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-size-75: 0.75rem;   /* 12px */
    --font-size-100: 0.875rem; /* 14px */
    --font-size-200: 1rem;     /* 16px */
    --font-size-300: 1.125rem; /* 18px */
    --font-size-400: 1.25rem;  /* 20px */
    --font-size-500: 1.5rem;   /* 24px */
    --font-size-600: 2rem;     /* 32px */
    
    /* Spacing Scale */
    --space-050: 0.125rem; /* 2px */
    --space-100: 0.25rem;  /* 4px */
    --space-200: 0.5rem;   /* 8px */
    --space-300: 0.75rem;  /* 12px */
    --space-400: 1rem;     /* 16px */
    --space-500: 1.25rem;  /* 20px */
    --space-600: 1.5rem;   /* 24px */
    --space-800: 2rem;     /* 32px */
    --space-1000: 2.5rem;  /* 40px */
    --space-1200: 3rem;    /* 48px */
    --space-1600: 4rem;    /* 64px */
    
    /* Border Radius */
    --border-radius-100: 0.25rem; /* 4px */
    --border-radius-200: 0.5rem;  /* 8px */
    --border-radius-300: 0.75rem; /* 12px */
    
    /* Shadows */
    --shadow-100: 0 1px 0 rgba(22, 29, 37, 0.05);
    --shadow-200: 0 3px 1px -1px rgba(22, 29, 37, 0.07), 0 2px 1px -1px rgba(22, 29, 37, 0.07), 0 1px 5px -2px rgba(22, 29, 37, 0.04);
    --shadow-300: 0 4px 6px -2px rgba(22, 29, 37, 0.05), 0 10px 15px -3px rgba(22, 29, 37, 0.10);
    
    /* Transitions */
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --easing-base: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ==========================================================================
   2. Loading States & Error Boundaries
   ========================================================================== */

/* Loading states for async operations */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn.loading {
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error boundary styles */
.error-boundary {
    background: var(--warning-bg);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius-200);
    padding: var(--space-600);
    margin-bottom: var(--space-600);
}


.error-boundary-content {
    text-align: center;
}

.error-boundary h3 {
    color: var(--warning-color);
    margin-bottom: var(--space-400);
}

.error-boundary p {
    color: var(--text-subdued);
    margin-bottom: var(--space-600);
}

/* Global error styles */
.global-error {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning-bg);
    border-bottom: 1px solid var(--warning-color);
    padding: var(--space-400);
    z-index: 1000;
    box-shadow: var(--shadow-200);
}

.global-error-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-400);
}

.global-error h3 {
    color: var(--warning-color);
    margin: 0;
    font-size: var(--font-size-200);
}

.global-error p {
    color: var(--text-subdued);
    margin: 0;
    flex: 1;
}

/* Form disabled state */
.form-disabled {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.form-disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Enhanced loading animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Skeleton loading states */
.skeleton {
    background: linear-gradient(90deg, var(--surface-secondary) 25%, var(--surface-subdued) 50%, var(--surface-secondary) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-100);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-200);
}

.skeleton-text:last-child {
    width: 60%;
}

/* Progress indicators */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-200);
    padding: var(--space-300);
    background: var(--info-bg);
    border: 1px solid var(--info-color);
    border-radius: var(--border-radius-200);
    margin-bottom: var(--space-400);
}

.progress-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--info-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-text {
    color: var(--info-color);
    font-size: var(--font-size-100);
    font-weight: 500;
}

/* ==========================================================================
   3. Accessibility & Form Validation
   ==========================================================================

   UNIFIED VALIDATION SYSTEM:
   - Consistent error styling across all form sections
   - Field-level errors appear inline below each field
   - Form-level errors display at top with complete error list
   - All errors use accessible ARIA attributes
   - Modern design inspired by Stripe, Shopify, and leading platforms

   ========================================================================== */

/* Fieldset and legend styling for better accessibility */
fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-200);
    padding: var(--space-400);
    margin: 0 0 var(--space-600) 0;
    background: var(--surface-primary);
}

legend {
    font-weight: 600;
    font-size: var(--font-size-200);
    color: var(--text-color);
    padding: 0 var(--space-200);
    margin-bottom: 0;
}

legend.required::after {
    content: ' *';
    color: var(--primary-color);
}

/* Enhanced focus styles for better accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus,
.file-upload-area:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(236, 26, 42, 0.1);
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced error states with better contrast */
.error {
    border-color: var(--warning-color) !important;
}

.error:focus {
    outline-color: var(--warning-color) !important;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1) !important;
}

/* Valid field states */
.valid {
    border-color: var(--success-color) !important;
}

.valid:focus {
    outline-color: var(--success-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.1) !important;
}

/* Form group validation states */
.form-group.error {
    position: relative;
}

.form-group.valid {
    position: relative;
}

/* Field error messages - unified styling for all form sections */
.field-error-message {
    display: flex;
    align-items: flex-start;
    gap: var(--space-200);
    margin-top: var(--space-300);
    padding: var(--space-300) var(--space-400);
    background: #FEF2F2;
    border-left: 3px solid #DC2626;
    border-radius: var(--border-radius-100);
    font-size: var(--font-size-100);
    font-weight: 500;
    color: #991B1B;
    line-height: 1.5;
    animation: slideInDown 0.3s ease-out;
}

.error-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #DC2626;
    margin-top: 2px;
}

.error-text {
    flex: 1;
    line-height: 1.5;
}

/* File error messages */
.file-error-message {
    margin-top: var(--space-400);
    animation: slideInDown 0.3s ease-out;
}

.file-error-content {
    display: flex;
    align-items: center;
    gap: var(--space-200);
    padding: var(--space-300) var(--space-400);
    background: var(--warning-bg);
    border: 1px solid var(--warning-color);
    border-radius: var(--border-radius-200);
    font-size: var(--font-size-100);
    color: var(--warning-color);
    font-weight: 500;
}

/* Success validation indicators - only show when no error message is present */
.form-group.valid:not(.error) {
    position: relative;
}

.form-group.valid:not(.error)::after {
    content: '✓';
    position: absolute;
    top: 2.4rem;
    right: var(--space-400);
    color: var(--success-color);
    font-weight: bold;
    font-size: var(--font-size-200);
    pointer-events: none;
    z-index: 1;
}

/* Adjust input padding when validation icon is present and no error */
.form-group.valid:not(.error) input,
.form-group.valid:not(.error) textarea,
.form-group.valid:not(.error) select {
    padding-right: var(--space-1000);
}

/* Animation for error messages */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for form elements */
.form-group.loading {
    position: relative;
}

.form-group.loading::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   4. Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    line-height: 1.6;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-200);
    color: var(--text-color);
    background-color: var(--surface-subdued);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   3. Layout & Container
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(0.75rem, 3vw, 1rem); /* 12px-16px responsive */
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

header {
    color: #211F44;
    padding: clamp(1rem, 3vw, 2rem) 0; /* 16px-32px responsive */
    text-align: center;
}

header .logo {
    width: 100%;
    max-width: clamp(200px, 50vw, 240px);
    height: auto;
    margin-bottom: clamp(0.5rem, 2vw, 1rem);
    border-radius: var(--border-radius-200);
}

header h1 {
    font-size: clamp(1.5rem, 4vw + 0.5rem, 2rem); /* Responsive 24px-32px */
    line-height: 1.1;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--space-200);
    letter-spacing: -0.025em;
    color: var(--primary-color);
}

header p {
    font-size: clamp(0.875rem, 2vw + 0.5rem, 1.125rem); /* Responsive 14px-18px */
    font-weight: 500;
    line-height: 1.5;
}

/* ==========================================================================
   5. Form Container & Sections
   ========================================================================== */

.form-container {
    background-color: var(--surface-primary);
    border-radius: var(--border-radius-300);
    box-shadow: var(--shadow-300);
    margin-bottom: clamp(1rem, 3vw, 2rem);
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.form-section {
    padding: clamp(0.875rem, 2vw, 1.5rem); /* 14px-24px responsive */
    border-bottom: 1px solid var(--border-subdued);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    left: 0;
    right: 0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    font-size: clamp(1.125rem, 3vw, 1.5rem); /* 18px-24px responsive */
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-color);
    margin-bottom: var(--space-400);
}

/* ==========================================================================
   6. Form Elements
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-600);
    padding: clamp(0.75rem, 2vw, 0); /* 12px on mobile, 0 on desktop */
}

label {
    display: block;
    font-size: var(--font-size-200);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--space-200);
    line-height: 1.4;
}

label.required::after {
    content: " *";
    color: var(--primary-color);
    font-weight: 600;
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: var(--space-300) var(--space-400);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-200);
    font-size: var(--font-size-100);
    font-family: var(--font-family-sans);
    background-color: var(--surface-primary);
    color: var(--text-color);
    transition: border-color var(--duration-200) var(--easing-base), 
                box-shadow var(--duration-200) var(--easing-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(236, 26, 42, 0.12);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled,
input[type="url"]:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--surface-disabled);
    border-color: var(--border-disabled);
    color: var(--text-disabled);
    cursor: not-allowed;
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-300) center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: var(--space-1000);
    appearance: none;
}

::placeholder {
    color: #6b7280;
    opacity: 1;
}

.hint {
    font-size: var(--font-size-75);
    color: #4b5563;
    margin-top: var(--space-200);
    line-height: 1.4;
}

fieldset .hint {
    margin-top: 0; /* Reduce spacing between legend and hint */
    margin-bottom: var(--space-400);
}

/* ==========================================================================
   7. File Upload
   ========================================================================== */

.file-upload-container {
    position: relative;
}

.file-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-200);
    padding: clamp(1rem, 4vw, 2rem); /* 16px-32px responsive */
    text-align: center;
    background-color: var(--surface-subdued);
    transition: border-color var(--duration-200) var(--easing-base),
                background-color var(--duration-200) var(--easing-base);
    cursor: pointer;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

#profile_image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

.file-upload-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-200);
    padding: var(--space-300) var(--space-500);
    background-color: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-200);
    font-size: var(--font-size-100);
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color var(--duration-200) var(--easing-base),
                border-color var(--duration-200) var(--easing-base);
}

.file-upload-button:hover {
    background-color: var(--surface-secondary);
    border-color: var(--border-focus);
}

.file-upload-text {
    font-size: var(--font-size-100);
    color: var(--text-subdued);
    margin-top: var(--space-300);
}

.file-name {
    font-size: var(--font-size-75);
    color: var(--text-color);
    font-weight: 500;
    margin-top: var(--space-200);
}

.image-preview {
    margin-top: var(--space-600);
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--border-radius-200);
    border: 1px solid var(--border-subdued);
    box-shadow: var(--shadow-100);
}

/* ==========================================================================
   8. Checkbox Groups
   ========================================================================== */

.checkbox-group {
    display: grid;
    gap: var(--space-200);
    padding: clamp(0.75rem, 2vw, 1rem); /* 12px-16px responsive */
    border: 1px solid var(--border-subdued);
    border-radius: var(--border-radius-200);
    background-color: var(--surface-subdued);
}

/* Responsive grid columns based on content */
.specialties-group,
.languages-group,
.instructor-levels-group {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-400);
    padding: clamp(0.75rem, 2vw, 1rem); /* 12px-16px responsive */
    background-color: var(--surface-primary);
    border: 1px solid var(--border-subdued);
    border-radius: var(--border-radius-200);
    cursor: pointer;
    transition: border-color var(--duration-150) var(--easing-base),
                box-shadow var(--duration-150) var(--easing-base),
                background-color var(--duration-150) var(--easing-base);
    min-height: 44px; /* Touch target size */
}

.checkbox-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-100);
}

.checkbox-item.checked {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: var(--shadow-100);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-item label {
    margin: 0;
    font-size: var(--font-size-100);
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    flex: 1;
    user-select: none;
}

/* ==========================================================================
   9. Region Fields
   ========================================================================== */

.region-group {
    display: none;
    animation: fadeIn var(--duration-300) var(--easing-base);
}

.region-group.show {
    display: block;
}

@keyframes fadeIn {
    from {
    opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   10. Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-200);
    padding: var(--space-400) var(--space-800);
    background-color: var(--interactive-normal);
    color: white;
    border: 1px solid var(--interactive-normal);
    border-radius: var(--border-radius-200);
    font-size: var(--font-size-100);
    font-weight: 600;
    font-family: var(--font-family-sans);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--duration-200) var(--easing-base),
                border-color var(--duration-200) var(--easing-base),
                transform var(--duration-150) var(--easing-base);
    min-height: 44px;
}

.btn:hover {
    background-color: var(--interactive-hover);
    border-color: var(--interactive-hover);
    transform: translateY(-1px);
}

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

.btn:disabled {
    background-color: var(--interactive-disabled);
    border-color: var(--interactive-disabled);
    color: var(--text-disabled);
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.submit-container {
    text-align: center;
    padding: clamp(1rem, 3vw, 2rem); /* Responsive padding */
}

/* ==========================================================================
   11. Messages & Validation
   ========================================================================== */

.success-message {
    max-width: 800px;
    min-height: 600px;
    margin: auto;
    padding: clamp(1rem, 3vw, var(--space-300));
    background-color: var(--surface-primary);
    text-align: center;
}

.success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: clamp(1rem, 3vw, var(--space-800));
    animation: scaleIn 0.5s var(--easing-base);
}

.success-icon svg {
    width: clamp(48px, 15vw, 64px);
    height: clamp(48px, 15vw, 64px);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-message h2 {
    font-size: clamp(1.25rem, 4vw, var(--font-size-500));
    color: var(--success-color);
    margin-bottom: clamp(0.75rem, 2vw, var(--space-600));
    font-weight: 600;
    line-height: 1.3;
}

.success-info-box {
    background-color: var(--success-bg);
    border-left: 4px solid var(--success-color);
    border-radius: var(--border-radius-200);
    padding: clamp(0.75rem, 2vw, var(--space-400));
    margin-bottom: clamp(0.75rem, 2vw, var(--space-600));
    text-align: left;
}

.success-info-box h3 {
    font-size: clamp(1rem, 3vw, var(--font-size-400));
    color: var(--success-color);
    margin-bottom: clamp(0.5rem, 1.5vw, var(--space-300));
    font-weight: 600;
}

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

.success-info-box li {
    padding: clamp(0.25rem, 1vw, var(--space-200)) 0;
    padding-left: clamp(1.5rem, 4vw, var(--space-800));
    position: relative;
    font-size: clamp(0.875rem, 2vw, var(--font-size-200));
    color: var(--text-color);
    line-height: 1.4;
}

.success-info-box li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: clamp(1rem, 2.5vw, var(--font-size-300));
}

.success-contact {
    color: var(--text-subdued);
    font-size: clamp(0.813rem, 1.8vw, var(--font-size-100));
    line-height: 1.5;
    margin: 0;
}

.success-contact a {
    color: var(--success-color);
    text-decoration: none;
    font-weight: 500;
}

.success-contact a:hover {
    text-decoration: underline;
}

.error {
    border-color: var(--warning-color) !important;
}

.error-message {
    color: var(--warning-color);
    font-size: var(--font-size-75);
    margin-top: var(--space-200);
}

/* ==========================================================================
   12. Footer
   ========================================================================== */

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 1.2rem;
    margin-top: 1.2rem;
    position: relative;
    z-index: 1;
}

footer p {
    font-size: var(--font-size-100);
    opacity: 0.9;
    margin-bottom: var(--space-200);
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    color: var(--footer-text);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--duration-200) var(--easing-base);
}

footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ==========================================================================
   13. Enhanced Loading States & Animations
   ========================================================================== */

.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin var(--duration-300) linear infinite;
}

/* Enhanced upload progress */
.upload-progress {
    margin-top: var(--space-400);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--surface-secondary);
    border-radius: var(--border-radius-100);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-100);
    transition: width 0.3s ease;
    animation: progress-shimmer 2s infinite;
}

.progress-text {
    margin-top: var(--space-200);
    font-size: var(--font-size-75);
    color: var(--text-subdued);
    text-align: center;
}

/* Character counter */
.character-counter {
    margin-top: var(--space-200);
    font-size: var(--font-size-75);
    color: var(--text-subdued);
    text-align: right;
}

.character-counter.valid {
    color: var(--success-color);
}

.character-counter.invalid {
    color: var(--warning-color);
}

/* Drag and drop enhancements */
.file-upload-area[data-drop-zone="true"] {
    position: relative;
    transition: all var(--duration-200) ease;
}

.file-upload-area[data-drop-zone="true"]:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    transform: scale(1.02);
}

.file-upload-area.drag-over::after {
    content: "Drop your image here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--primary-color);
    font-size: var(--font-size-300);
    pointer-events: none;
}

/* Keyboard focus enhancement */
.using-keyboard .file-upload-area:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced animations */
@keyframes progress-shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

/* Real-time validation feedback */
.form-group.validating input,
.form-group.validating textarea,
.form-group.validating select {
    border-color: var(--border-color);
    animation: pulse 1s ease-in-out;
}

.form-group.valid input,
.form-group.valid textarea,
.form-group.valid select {
    border-color: var(--success-color);
}

.form-group.invalid input,
.form-group.invalid textarea,
.form-group.invalid select {
    border-color: var(--warning-color);
}

.validation-message {
    margin-top: var(--space-200);
    font-size: var(--font-size-75);
    animation: fadeIn 0.3s ease;
}

.validation-message.success {
    color: var(--success-color);
}

.validation-message.error {
    color: var(--warning-color);
}

/* Enhanced focus states for better accessibility */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(236, 26, 42, 0.1);
}

/* Focus states for validation */
input.error:focus,
textarea.error:focus,
select.error:focus {
    outline-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

input.valid:focus,
textarea.valid:focus,
select.valid:focus {
    outline-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(0, 128, 96, 0.1);
}

/* Loading states for validation */
.form-group.validating {
    position: relative;
}

.form-group.validating::after {
    content: '';
    position: absolute;
    top: 50%;
    right: var(--space-400);
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   13. International Phone Input
   ========================================================================== */

/* Modern phone input with inline country code selector */
.phone-input-wrapper {
    position: relative;
}

.phone-input-container {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-200);
    overflow: hidden;
    transition: border-color var(--duration-150) var(--easing-base),
                box-shadow var(--duration-150) var(--easing-base);
}

.phone-input-container:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Country code button */
.country-code-button {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 1vw, 0.5rem);
    padding: 0 clamp(0.75rem, 2vw, 1rem);
    background-color: var(--surface-secondary);
    border: none;
    border-right: 1px solid var(--border-subdued);
    font-family: var(--font-family-sans);
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color var(--duration-150) var(--easing-base);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
}

.country-code-button:hover {
    background-color: var(--surface-subdued);
}

.country-code-button:focus {
    outline: none;
    background-color: var(--surface-subdued);
}

.flag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 15px;
    vertical-align: middle;
}

/* Flag icons library integration - ensure flags are properly sized */
.flag-icon .fi {
    width: 20px;
    height: 15px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.country-code {
    font-weight: 500;
    color: var(--text-color);
}

.dropdown-arrow {
    margin-left: clamp(0.125rem, 0.5vw, 0.25rem);
    opacity: 0.6;
    transition: transform var(--duration-150) var(--easing-base);
}

.country-code-button[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Phone number input */
.phone-number-input {
    flex: 1;
    border: none;
    padding: var(--space-300) var(--space-400);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-200);
    color: var(--text-color);
    background: transparent;
    min-height: 44px;
}

.phone-number-input:focus {
    outline: none;
}

.phone-number-input::placeholder {
    color: var(--text-disabled);
}

/* Country dropdown */
.country-code-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-200);
    box-shadow: var(--shadow-300);
    z-index: 1000;
    max-height: 320px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.country-code-dropdown[style*="display: block"],
.country-code-dropdown[style*="display: flex"] {
    display: flex !important;
}

/* Search input */
.dropdown-search {
    padding: var(--space-400);
    border-bottom: 1px solid var(--border-subdued);
    background: var(--surface-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.country-search-input {
    width: 100%;
    padding: var(--space-300) var(--space-400);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-200);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-200);
    background: var(--surface-primary);
    transition: border-color var(--duration-150) var(--easing-base);
}

.country-search-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Country list */
.country-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: 260px;
}

.country-item {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1rem);
    padding: clamp(0.75rem, 2vw, 1rem);
    cursor: pointer;
    transition: background-color var(--duration-150) var(--easing-base);
    min-height: 48px;
}

.country-item:hover {
    background-color: var(--surface-secondary);
}

.country-item:focus {
    outline: none;
    background-color: var(--surface-secondary);
}

.country-item.selected {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

/* Country flag container in dropdown list */
.country-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
    flex-shrink: 0;
}

/* Flag icons styling for dropdown items */
.country-flag .fi {
    width: 24px;
    height: 18px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.country-name {
    flex: 1;
    font-size: var(--font-size-200);
    color: var(--text-color);
}

.country-dial-code {
    font-size: var(--font-size-100);
    color: var(--text-subdued);
    font-weight: 500;
}

/* Scrollbar styling */
.country-list::-webkit-scrollbar {
    width: 8px;
}

.country-list::-webkit-scrollbar-track {
    background: var(--surface-subdued);
}

.country-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-subdued);
}

/* ==========================================================================
   14. Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        min-height: 48px;
    }

    /* Mobile optimization for phone input */
    .country-code-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: none;
        border-radius: 0;
        z-index: 9999;
    }

    .country-list {
        max-height: calc(100vh - 120px);
    }

    .country-item {
        min-height: 48px;
        padding: var(--space-400);
    }

    .dropdown-search {
        padding: var(--space-400);
    }

    .country-search-input {
        min-height: 48px;
        font-size: 16px;
    }
}

/* ============================================================================
   15. Duplicate Warning Notification (Inline Card)
   ============================================================================ */

/* Overlay backdrop - semi-transparent */
.duplicate-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(33, 31, 68, 0.75); /* Brand dark with transparency */
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-800);
    overflow-y: auto;
}

/* Notification card - Stripe/Shopify pattern */
.duplicate-warning-card {
    position: relative;
    background: var(--surface-primary);
    border-radius: var(--border-radius-300);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 560px;
    width: 100%;
    margin-top: var(--space-1000);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

/* Close button - top right corner */
.close-warning {
    position: absolute;
    top: var(--space-400);
    right: var(--space-400);
    background: transparent;
    border: none;
    padding: var(--space-200);
    cursor: pointer;
    color: var(--text-subdued);
    border-radius: var(--border-radius-100);
    transition: all var(--duration-200) var(--easing-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    z-index: 1;
}

.close-warning:hover {
    background: var(--surface-secondary);
    color: var(--text-color);
}

.close-warning:active {
    transform: scale(0.95);
}

/* Warning header - icon + title */
.warning-header {
    display: flex;
    align-items: center;
    gap: var(--space-400);
    padding: var(--space-600);
    padding-bottom: var(--space-500);
}

.warning-icon-circle {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.warning-header h3 {
    margin: 0;
    font-size: var(--font-size-400);
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
}

/* Warning message */
.warning-message {
    padding: 0 var(--space-600);
    margin: 0 0 var(--space-600);
    font-size: var(--font-size-200);
    line-height: 1.6;
    color: var(--text-subdued);
}

/* Action buttons container */
.warning-actions {
    padding: var(--space-600);
    padding-top: 0;
    display: flex;
    gap: var(--space-300);
    flex-wrap: wrap;
}

.warning-actions .btn {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-200);
    padding: var(--space-400) var(--space-500);
    font-size: var(--font-size-100);
    font-weight: 600;
    border-radius: var(--border-radius-200);
    transition: all var(--duration-200) var(--easing-base);
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

/* Primary button - Contact Support */
.btn-contact {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(236, 26, 42, 0.2);
}

.btn-contact:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(236, 26, 42, 0.3);
    transform: translateY(-1px);
}

.btn-contact:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(236, 26, 42, 0.2);
}

/* Secondary button - Cancel */
.warning-actions .btn-secondary {
    background: var(--surface-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.warning-actions .btn-secondary:hover {
    background: var(--surface-subdued);
    border-color: var(--border-color);
}

/* Help text */
.warning-help {
    padding: var(--space-500) var(--space-600);
    padding-top: 0;
    margin: 0;
    font-size: var(--font-size-75);
    line-height: 1.5;
    color: var(--text-disabled);
    text-align: center;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Mobile optimizations */
@media (max-width: 640px) {
    .duplicate-warning-overlay {
        padding: var(--space-400);
        align-items: center;
    }

    .duplicate-warning-card {
        margin-top: 0;
        max-width: 100%;
    }

    .warning-header {
        padding: var(--space-500);
        gap: var(--space-300);
    }

    .warning-icon-circle {
        width: 40px;
        height: 40px;
    }

    .warning-header h3 {
        font-size: var(--font-size-300);
    }

    .warning-message {
        padding: 0 var(--space-500);
        margin-bottom: var(--space-500);
        font-size: var(--font-size-100);
    }

    .warning-actions {
        padding: var(--space-500);
        padding-top: 0;
        flex-direction: column;
    }

    .warning-actions .btn {
        width: 100%;
        min-width: unset;
    }

    .warning-help {
        padding: var(--space-400) var(--space-500);
        padding-top: 0;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .duplicate-warning-card {
        max-width: 500px;
    }
}

/* ============================================================================
   16. Validation and Submission Error Messages
   ============================================================================ */

/* Validation error message - shown at top of form with modern design */
.validation-error-message,
.submission-error-message {
    background: linear-gradient(to right, #FEF2F2, #FFFFFF);
    border: 1px solid #FCA5A5;
    border-left: 4px solid #DC2626;
    border-radius: var(--border-radius-300);
    padding: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: var(--space-600);
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.1), 0 2px 4px -1px rgba(220, 38, 38, 0.06);
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-error-content,
.submission-error-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-400);
}

/* Error header with icon */
.validation-error-content h3,
.validation-error-content .error-header,
.submission-error-content h3 {
    margin: 0;
    color: #991B1B;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-300);
}

.validation-error-content h3 svg,
.validation-error-content .error-header svg,
.submission-error-content h3 svg {
    flex-shrink: 0;
    color: #DC2626;
}

/* Error list */
.validation-error-content ul,
.validation-error-content .error-list {
    margin: 0;
    padding-left: var(--space-600);
    list-style: none;
}

.validation-error-content li,
.validation-error-content .error-list li,
.submission-error-content p {
    color: #7C2D12;
    font-size: var(--font-size-100);
    line-height: 1.6;
    margin: var(--space-200) 0;
    position: relative;
}

.validation-error-content li::before,
.validation-error-content .error-list li::before {
    content: '•';
    position: absolute;
    left: calc(-1 * var(--space-500));
    color: #DC2626;
    font-weight: bold;
}

/* Close button styling */
.validation-error-content .btn,
.validation-error-content .btn-close-error,
.submission-error-content .btn {
    align-self: flex-start;
    margin-top: var(--space-200);
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    color: #374151;
    padding: var(--space-200) var(--space-500);
    font-size: var(--font-size-100);
}

.validation-error-content .btn:hover,
.validation-error-content .btn-close-error:hover,
.submission-error-content .btn:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

/* Checkbox group error styling */
.checkbox-group.error {
    border-color: #FCA5A5;
    background-color: #FEF2F2;
}

fieldset.error {
    border-color: #FCA5A5;
    background-color: #FEF2F2;
}

fieldset .field-error-message {
    margin-top: var(--space-400);
}
