/**
 * Enhanced Expression of Interest Form - Mobile-Optimized Styles
 * Fully responsive design with signature capture support
 */

/* =============================================================================
   ENHANCED EOI FORM - BASE STYLES
   ============================================================================= */

.osb-enhanced-eoi-form {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Form Header */
.osb-eoi-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #0052cc 0%, #003d99 50%, #004080 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 82, 204, 0.3);
}

.osb-header-icon {
    flex-shrink: 0;
}

.osb-header-icon .osb-icon {
    font-size: 3rem;
    display: block;
}

.osb-form-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.osb-form-subtitle {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

/* Form Progress */
.osb-form-progress {
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.osb-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.osb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.osb-progress-text {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}

/* Form Sections */
.osb-form-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.osb-section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f4;
}

.osb-section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.osb-section-icon {
    font-size: 1.8rem;
}

.osb-section-description {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Grid */
.osb-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

.osb-form-group.osb-full-width {
    grid-column: 1 / -1;
}

/* Form Elements */
.osb-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.95rem;
}

.osb-label.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: 700;
}

.osb-input,
.osb-select,
.osb-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.osb-input:focus,
.osb-select:focus,
.osb-textarea:focus {
    outline: none;
    border-color: #0052cc;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.osb-input.osb-valid,
.osb-select.osb-valid,
.osb-textarea.osb-valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

.osb-input.osb-invalid,
.osb-select.osb-invalid,
.osb-textarea.osb-invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.osb-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Validation Messages */
.osb-validation-message {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Checkbox Groups */
.osb-terms-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.osb-checkbox-group {
    position: relative;
}

.osb-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: #fff;
}

.osb-checkbox-label:hover {
    border-color: #0052cc;
    background: #f8f9ff;
}

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

.osb-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.2rem;
    transition: all 0.2s ease;
}

.osb-checkbox-label input[type="checkbox"]:checked + .osb-checkbox-custom {
    background: #0052cc;
    border-color: #0052cc;
}

.osb-checkbox-label input[type="checkbox"]:checked + .osb-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.osb-checkbox-text {
    flex: 1;
    line-height: 1.5;
    color: #495057;
}

/* =============================================================================
   SIGNATURE CAPTURE SECTION
   ============================================================================= */

.osb-signature-section {
    margin-top: 1.5rem;
}

.osb-signature-container {
    position: relative;
    border: 3px dashed #dee2e6;
    border-radius: 15px;
    background: #fff;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.osb-signature-container:hover {
    border-color: #0052cc;
    background: #f8f9ff;
}

.osb-signature-canvas {
    display: block;
    width: 100%;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
}

.osb-signature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 250, 0.9);
    pointer-events: none;
    z-index: 1;
}

.osb-signature-prompt {
    text-align: center;
    color: #6c757d;
}

.osb-signature-prompt .osb-signature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.osb-signature-prompt p {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.osb-signature-prompt small {
    font-size: 0.875rem;
    opacity: 0.8;
}

.osb-signature-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.osb-signature-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.osb-status-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.osb-status-success {
    color: #28a745;
}

.osb-status-error {
    color: #dc3545;
}

.osb-signature-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.osb-signature-info p {
    margin: 0 0 1rem 0;
    font-weight: 600;
    color: #495057;
}

.osb-signature-info ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #6c757d;
}

.osb-signature-info li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* =============================================================================
   BUTTONS AND ACTIONS
   ============================================================================= */

.osb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.osb-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.osb-btn-primary {
    background: linear-gradient(135deg, #0052cc 0%, #003d99 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.3);
}

.osb-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
}

.osb-btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.osb-btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.osb-btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.osb-btn-icon {
    font-size: 1.2rem;
}

.osb-btn-loading {
    gap: 0.75rem;
}

.osb-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Actions */
.osb-form-actions {
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.osb-action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.osb-form-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.osb-footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* =============================================================================
   SUBMITTED STATE
   ============================================================================= */

.osb-eoi-submitted {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.osb-success-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.osb-eoi-submitted h3 {
    font-size: 1.8rem;
    color: #28a745;
    margin: 0 0 1rem 0;
    font-weight: 700;
}

.osb-eoi-submitted p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0 0 2rem 0;
}

.osb-submission-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.osb-detail-item {
    text-align: left;
}

.osb-detail-label {
    display: block;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.osb-detail-value {
    display: block;
    color: #2c3e50;
    font-weight: 500;
}

.osb-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.osb-status-pending {
    background: #fff3cd;
    color: #856404;
}

.osb-status-approved {
    background: #d4edda;
    color: #155724;
}

.osb-status-submitted {
    background: #cce7ff;
    color: #004085;
}

.osb-next-steps {
    text-align: left;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 10px;
}

.osb-next-steps p {
    margin: 0 0 1rem 0;
    font-weight: 600;
    color: #004085;
}

.osb-next-steps ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #495057;
}

.osb-next-steps li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* =============================================================================
   AUTO-SAVE NOTIFICATION
   ============================================================================= */

.osb-autosave-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.osb-autosave-icon {
    font-size: 1.1rem;
}

/* =============================================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATIONS
   ============================================================================= */

@media (max-width: 768px) {
    .osb-enhanced-eoi-form {
        padding: 1rem;
        margin: 0;
        border-radius: 10px;
    }

    .osb-eoi-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }

    .osb-form-title {
        font-size: 1.8rem;
    }

    .osb-form-subtitle {
        font-size: 1rem;
    }

    .osb-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .osb-form-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .osb-section-title {
        font-size: 1.3rem;
    }

    .osb-action-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .osb-btn {
        width: 100%;
        justify-content: center;
    }

    .osb-signature-canvas {
        height: 150px;
    }

    .osb-signature-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .osb-submission-details {
        grid-template-columns: 1fr;
    }

    .osb-autosave-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .osb-enhanced-eoi-form {
        padding: 0.5rem;
    }

    .osb-eoi-header {
        padding: 1rem;
    }

    .osb-form-title {
        font-size: 1.5rem;
    }

    .osb-form-section {
        padding: 1rem;
    }

    .osb-input,
    .osb-select,
    .osb-textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .osb-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .osb-signature-canvas {
        height: 120px;
    }

    .osb-signature-prompt .osb-signature-icon {
        font-size: 1.5rem;
    }

    .osb-signature-prompt p {
        font-size: 1rem;
    }

    .osb-signature-prompt small {
        font-size: 0.8rem;
    }
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .osb-input,
    .osb-select,
    .osb-textarea {
        border-width: 3px;
    }

    .osb-btn {
        border: 2px solid currentColor;
    }
}

/* Focus styles for keyboard navigation */
.osb-input:focus-visible,
.osb-select:focus-visible,
.osb-textarea:focus-visible,
.osb-btn:focus-visible {
    outline: 3px solid #0052cc;
    outline-offset: 2px;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .osb-enhanced-eoi-form {
        box-shadow: none;
        background: white;
    }

    .osb-eoi-header {
        background: white !important;
        color: black !important;
        box-shadow: none;
    }

    .osb-form-actions,
    .osb-signature-controls {
        display: none;
    }

    .osb-signature-canvas {
        border: 1px solid #000;
    }
}