/* Life Insurance Form - New Styles */

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.enhanced-form-field.full-width {
    grid-column: 1 / -1;
}

/* Enhanced Form Fields */
.enhanced-form-field {
    margin-bottom: 1.5rem;
    position: relative;
}

.enhanced-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.optional-text {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.75rem;
}

.enhanced-input, .enhanced-select, .enhanced-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.enhanced-input:focus, .enhanced-select:focus, .enhanced-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(89, 34, 96, 0.1);
}

.enhanced-input.error, .enhanced-select.error, .enhanced-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.enhanced-select {
    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 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

/* Range Input Styles */
.range-input-container {
    margin-bottom: 1rem;
}

.enhanced-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 0.5rem;
}

.enhanced-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(89, 34, 96, 0.3);
    transition: all 0.2s ease;
}

.enhanced-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(89, 34, 96, 0.4);
}

.enhanced-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(89, 34, 96, 0.3);
    transition: all 0.2s ease;
}

.enhanced-range::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(89, 34, 96, 0.4);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.range-value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.currency-input {
    position: relative;
    flex: 1;
    display: flex;
    align-items: stretch;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.currency-input:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

.currency-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(89, 34, 96, 0.12), 0 4px 12px rgba(89, 34, 96, 0.08);
    transform: translateY(-1px);
}

.currency-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), 0 4px 12px rgba(239, 68, 68, 0.08);
}

.currency-symbol {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-weight: 700;
    color: #374151;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 2px solid #e2e8f0;
    flex-shrink: 0;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    position: relative;
}

.currency-symbol::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #cbd5e1, transparent);
}

.currency-input-field {
    border: none;
    outline: none;
    padding: 1rem 1.25rem;
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
    color: #1f2937;
    letter-spacing: 0.025em;
}

.currency-input-field::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.currency-input-field:focus {
    color: var(--primary-color);
}

.input-suffix {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.field-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Toggle Group Styles */
.toggle-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.toggle-option {
    cursor: pointer;
    position: relative;
}

.toggle-option input[type="radio"] {
    display: none;
}

.toggle-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 80px;
    text-align: center;
}

.toggle-option:hover .toggle-button {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.toggle-option input[type="radio"]:checked + .toggle-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(89, 34, 96, 0.3);
}

/* Conditional Fields */
.conditional-field {
    transition: all 0.3s ease;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.has-error .error-message {
    display: block;
}

/* Consent Section */
.consent-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 1rem;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

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

.checkbox-text {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
}

.text-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.text-link:hover {
    color: var(--secondary-color);
}

/* Form Step Header */
.form-step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-step-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.form-step-subtitle {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Form Step Animation */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.form-step.active {
    display: block;
}

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

/* Enhanced intl-tel-input styling */
.iti {
    width: 100%;
    display: block;
}

.iti__country-list {
    z-index: 1050;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
}

.iti__selected-flag {
    padding: 0 8px;
}

.iti input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 52px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.iti input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(89, 34, 96, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-step-title {
        font-size: 1.5rem;
    }
    
    .form-step-subtitle {
        font-size: 0.875rem;
    }
    
    .toggle-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .toggle-button {
        width: 100%;
    }
    
    .range-value-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .currency-input {
        min-width: 0;
    }
    
    .currency-symbol {
        padding: 0 0.75rem;
        font-size: 0.8rem;
    }
    
    .currency-input-field {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* CSS Variables */
:root {
    --primary-color: #592260;
    --secondary-color: #00a89c;
    --primary-color-light: rgba(89, 34, 96, 0.1);
}
