/**
 * GPS World Subscription Form Customizations
 * Custom styles for the Omeda subscription form template
 */

/* ==========================================================================
   Subscription Form Container
   ========================================================================== */

.subscription-form-container {
    max-width: 1320px;
    margin: 0 auto;
}

.wp-omeda-form-wrapper {
    background: transparent;
    padding: unset;
    border-radius: 0;
    box-shadow: none;
}

/* ==========================================================================
   Form Headers and Titles
   ========================================================================== */

.subscription-form-container h1 {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: left;
    font-family: 'Suez One', serif;
}

.subscription-form-container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0;
    padding-bottom: 0;
}

.subscription-form-container h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* ==========================================================================
   Form Sections
   ========================================================================== */

.subscription-section,
.personal-info-section,
.demographics-section {
    margin-bottom: 2.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 3px;
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    background-color: #f8f9fa;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    outline: none;
}

/* ==========================================================================
   Form Rows and Grid Layout
   ========================================================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.state-province-group {
    position: relative;
}

/* ==========================================================================
   Checkboxes and Radio Buttons
   ========================================================================== */

.form-check {
    margin-bottom: 0.75rem;
}

.form-check-input {
    width: 30px;
    height: 30px;
    margin-top: 2px;
    margin-right: 1rem;
    border: 2px solid #c1c2c3;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #1563ba;
    border-color: #03468f;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-check-label {
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0 !important;
}

/* ==========================================================================
   Subscription Options
   ========================================================================== */

.subscription-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.subscription-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 3px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.subscription-option .form-check {
    margin-bottom: 0;
}

.subscription-option.selected {
    border-color: #03468f;
    background-color: #e9f0ff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.subscription-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.subscription-option .h3 {
    display: none;
    visibility: hidden;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    font-weight: 500;
}

.subscription-status.active {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.subscription-status .dashicons {
    color: #28a745;
    font-size: 1.2rem;
}

/* ==========================================================================
   Subscription Term Options
   ========================================================================== */

.subscription-term-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, max-content));
    gap: 1.5rem;
    justify-content: start;
}

.subscription-term-options .subscription-term-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 3px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.subscription-term-options .subscription-term-option.selected {
    border-color: #03468f;
    background-color: #e9f0ff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.subscription-term-options .subscription-term-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.subscription-term-options .subscription-term-option .form-check-input {
    margin-left: 0 !important;
}

/* ==========================================================================
   Newsletter Options
   ========================================================================== */

.newsletter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.newsletter-options .newsletter-option {
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    border-radius: 3px;
}

.newsletter-options .newsletter-option:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.newsletter-options .newsletter-option.selected {
    border-color: #03468f;
    background-color: #e9f0ff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.newsletter-options .newsletter-option .form-check {
    margin-bottom: 0;
}

.newsletter-options .newsletter-option .form-check-input {
    margin-left: 0 !important;
    border-color: #c1c2c3;
    border-radius: 3px;
    width: 30px;
    height: 30px;
}

.newsletter-options .newsletter-option .form-check-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.newsletter-options .newsletter-option .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* ==========================================================================
   Validation and Status Messages
   ========================================================================== */

.validation-status {
    padding: 1rem;
    border-radius: 3px;
    margin: 1rem 0;
}

.validation-status.valid {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.validation-status.invalid {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.validation-status.loading {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.wp-omeda-alert {
    padding: 1rem;
    border-radius: 3px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.wp-omeda-alert.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.wp-omeda-alert.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.wp-omeda-alert.info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ==========================================================================
   Form Actions and Buttons
   ========================================================================== */

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: none;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ==========================================================================
   Form Steps
   ========================================================================== */

.wp-omeda-step-1,
.wp-omeda-step-2 {
    transition: all 0.3s ease;
}

.recap {
    background: #fff;
    padding: 1rem;
    font-size: 1.5rem;
}

/* ==========================================================================
   Stripe Card Element
   ========================================================================== */

#wp-omeda-card-element {
    border: 2px solid #e9ecef;
    border-radius: 3px;
    padding: 1rem;
    background: #fff;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
}

#wp-omeda-card-element.StripeElement--focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

#wp-omeda-card-element.StripeElement--invalid {
    border-color: #dc3545;
}

/* ==========================================================================
   GDPR Consent
   ========================================================================== */

.checkbox-group {
    margin: 1rem 0;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.2rem;
    height: 1.2rem;
}

#gdpr-consent-fallback {
    margin: 1rem 0;
}

#gdpr-consent-fallback a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

#gdpr-consent-fallback a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Form Notes and Descriptions
   ========================================================================== */

.form-note {
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.description {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.text-muted {
    color: #6c757d !important;
    font-size: 1.25rem;
}

/* ==========================================================================
   Required Field Indicators
   ========================================================================== */

/* Validation feedback messages */
.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #198754;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Additional styling for enhanced UX */
/* Only apply valid/invalid styling to required fields */
.wp-omeda-form input[required]:invalid,
.wp-omeda-form select[required]:invalid,
.wp-omeda-form textarea[required]:invalid {
    border-color: #dc3545;
    box-shadow: none;
}

.wp-omeda-form input[required]:valid,
.wp-omeda-form select[required]:valid,
.wp-omeda-form textarea[required]:valid {
    border-color: #198754;
    box-shadow: none;
}

/* ==========================================================================
   Demographic Fields
   ========================================================================== */

.demographic-field {
    margin-bottom: 1rem;
}

.demographic-checkbox-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

.demographic-checkbox-group .demographic-checkbox-option {
    flex-grow: 0;
    margin-bottom: 0;
    padding: 1rem 1.5rem;
    border-radius: 3px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.demographic-checkbox-group .demographic-checkbox-option .form-check-input {
    margin-left: 0 !important;
}

.demographic-checkbox-group .demographic-checkbox-option .form-check-label {
    white-space: nowrap;
    display: inline-block;
    width: fit-content;
}

/* ==========================================================================
   Email Check Section
   ========================================================================== */

.email-check-section {
    position: relative;
}

#omeda-email-status-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .subscription-form-container {
        padding: 1rem;
    }
    
    .wp-omeda-form-wrapper {
        padding: 1.5rem;
    }
    
    .subscription-form-container h1 {
        font-size: 2rem;
    }
    
    .subscription-options {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .demographic-checkbox-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .wp-omeda-form-wrapper {
        padding: 1rem;
    }
    
    .subscription-form-container h1 {
        font-size: 1.75rem;
    }
    
    .subscription-section,
    .personal-info-section,
    .demographics-section {
        padding: 1rem;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .form-control,
    .form-select,
    .btn,
    .subscription-option {
        transition: none;
    }
    
    .loading::after {
        animation: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .subscription-form-container {
        box-shadow: none;
        padding: 0;
    }
    
    .wp-omeda-form-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn,
    .form-actions {
        display: none;
    }
}
