/* ==========================================================================
   ORDER FORM V2 - PROFESSIONAL DESIGN
   ========================================================================== */
.order-section-v2 {
    /* background: var(--color-primary-dark); */
    padding: 80px 20px;
    background: linear-gradient(135deg, #0066ccad 0%, #00449900 100%);
    position: relative;
    backdrop-filter: blur(61px);
}

.order-header {
    text-align: center;
    margin-bottom: 60px;
}

.order-header .section-title {
    color: var(--color-secondary-dark);
    margin-bottom: 16px;
}

.order-header .section-subtitle {
    color: #ffffff;
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Alert Styles */
.alert {
    margin-bottom: 40px;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #fecaca;
    background: #fef2f2;
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-title {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 8px;
}

.alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #991b1b;
}

.alert-list li {
    margin-bottom: 4px;
}

.alert-list li::before {
    content: '•';
    margin-right: 8px;
}

/* Two Column Layout */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 60px;
    }
}

/* Form Styling */
.checkout-form {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 32px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    /* margin-bottom: 24px; */
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-field {
    margin-bottom: 16px;
}

.form-label-v2 {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.required {
    color: #ef4444;
    margin-left: 2px;
}

.form-input-v2 {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease-in-out;
    background: #ffffff;
}

.form-input-v2:focus {
    outline: none;
    border-color: #003d7a;
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

.form-input-v2::placeholder {
    color: #9ca3af;
}

/* Checkbox Styling */
.form-checkbox-v2 {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    margin: 0;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-input:checked {
    background-color: #003d7a;
    border-color: #003d7a;
}

.checkbox-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    cursor: pointer;
}

/* Submit Button */
.form-submit-v2 {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #003d7a;
    border: none;
    padding: 20px 32px;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
}

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

/* Order Summary */
.order-summary {
    position: relative;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #003d7a;
    margin-bottom: 24px;
    text-align: center;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.item-name {
    font-weight: 600;
    color: #374151;
}

.item-price {
    font-weight: 700;
    color: #003d7a;
    font-size: 1.125rem;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #003d7a;
    margin-bottom: 24px;
}

.total-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: #003d7a;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: #003d7a;
}

/* Benefits List */
.summary-benefits {
    margin-top: 12px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.benefit-icon {
    color: #10b981;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.benefit-text {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Summary Disclaimers */
.summary-disclaimers {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.disclaimer-text {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
    margin: 4px 0;
    font-style: italic;
}

/* Legal Notice */
.legal-notice {
    text-align: center;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}

.legal-notice p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.legal-link {
    color: #003d7a;
    text-decoration: underline;
}

.legal-link:hover {
    color: #0056a6;
}

.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    color: #10b981;
}

.security-icon {
    font-size: 1rem;
}

/* Mobile Responsive for Floating Labels */
@media (max-width: 640px) {
    .floating-control {
        padding: 22px 14px 6px 14px;
        font-size: 0.95rem;
    }
    
    .floating-label {
        left: 14px;
        font-size: 0.95rem;
    }
    
    .floating-group.focused .floating-label,
    .floating-control:focus + .floating-label,
    .floating-control:not(:placeholder-shown) + .floating-label {
        left: 10px;
        font-size: 0.7rem;
    }
    
    .floating-group {
        margin-bottom: 20px;
    }
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .order-section-v2 {
        padding: 40px 8px;
    }
    
    .order-section-v2 .container {
        max-width: 100%;
        padding: 0 8px;
    }

    .checkout-layout {
        gap: 24px;
        max-width: 100%;
        margin: 0;
    }

    .order-summary {
        padding: 0;
        margin: 0 0 40px 0;
    }

    .checkout-form,
    .summary-card {
        padding: 20px 16px;
        margin: 0;
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Make the form and cart full width */
    .checkout-form {
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .summary-card {
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Form specific mobile adjustments */
    .form-section {
        margin-bottom: 24px;
    }
    
    .form-grid {
        gap: 16px;
    }
    
    /* Order header mobile optimization */
    .order-header {
        margin-bottom: 40px;
    }
    
    .order-header .section-title {
        font-size: 1.75rem;
        margin-bottom: 12px;
    }
    
    .order-header .section-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Summary card mobile optimizations */
    .summary-title {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }
    
    .summary-item {
        padding: 12px 0;
    }
    
    .item-name {
        font-size: 0.9rem;
    }
    
    .item-price {
        font-size: 1rem;
    }
    
    .summary-total {
        padding: 16px 0;
        margin-bottom: 20px;
    }
    
    .total-label {
        font-size: 1.1rem;
    }
    
    .total-amount {
        font-size: 1.25rem;
    }
    
    .benefit-item {
        margin-bottom: 10px;
    }
    
    .benefit-text {
        font-size: 0.8rem;
    }
    
    .btn-checkout {
        padding: 18px 24px;
        font-size: 1rem;
    }
    
    /* Legal notice mobile optimization */
    .legal-notice {
        margin-top: 30px;
        padding-top: 24px;
    }
    
    .legal-notice p {
        font-size: 0.8rem;
    }
}

/* Form Validation States */
.form-input-v2.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input-v2.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* HTML5 Validation Styles - Only show validation after interaction */
/* Hide validation for untouched fields */
.form-input-v2:invalid:not(.touched):not(:focus) {
    border-color: #d1d5db; /* Default gray border */
}

/* Show validation only after user has touched the field and it's not empty */
.form-input-v2.touched:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-input-v2.touched:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Focus states */
.form-input-v2.touched:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input-v2.touched:valid:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Show validation only after form submission attempt */
.form-submitted .form-input-v2:invalid {
    border-color: #ef4444;
}

.form-submitted .form-input-v2:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Custom validation message styling */
.form-field {
    position: relative;
}

.form-input-v2.touched:invalid:not(:placeholder-shown) + .validation-message,
.form-submitted .form-input-v2:invalid + .validation-message,
.validation-message {
    display: block;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}
