:root {
    --primary-color: #0052FF;
    --primary-hover: #0043D6;
    --bg-color: #F4F7FB;
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-sub: #374151;
    --text-light: #4B5563;
    --border-color: #D1D5DB;
    --input-bg: #F9FAFB;
    --error-color: #EF4444;
    --success-color: #10B981;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: "맑은 고딕", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header */
.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.subtitle {
    color: var(--text-sub);
    font-size: 16px;
    margin-bottom: 32px;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step span {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.step.active .step-circle {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.step.active span {
    color: var(--primary-color);
    font-weight: 600;
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: var(--border-color);
    margin: 0 16px;
    transform: translateY(-12px);
}

/* Form Container */
.insurance-form {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.form-section {
    padding: 32px 40px;
    border-bottom: 1px solid var(--border-color);
}

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

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-sub);
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

/* Labels and Inputs */
label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group:not(.terms-box):has(input[required]) > label::after,
.input-group:not(.terms-box):has(select[required]) > label::after {
    content: "*";
    color: var(--error-color);
    margin-left: 4px;
    font-weight: 700;
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #E0E7FF;
    color: #4338CA;
    font-weight: 500;
}
.badge.optional {
    background-color: var(--border-color);
    color: var(--text-sub);
}
.badge.recommended {
    background-color: #DCFCE7;
    color: #166534;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 400;
    font-family: inherit;
    color: var(--text-main);
    background-color: #FFFFFF;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1);
}

input::placeholder {
    color: var(--text-light);
}

.tip-text {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* Radio Buttons for Transport Mode */
.radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: #FFFFFF;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.radio-label input:checked ~ .radio-custom {
    border-color: var(--primary-color);
    background-color: rgba(0, 82, 255, 0.05);
    color: var(--primary-color);
}

/* Coverage Selection (Checkbox Cards) */
.checkbox-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-card {
    position: relative;
    cursor: pointer;
}

.checkbox-card input {
    position: absolute;
    opacity: 0;
}

.card-content {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    height: 100%;
}

.card-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-sub);
}

.checkbox-card input:checked ~ .card-content {
    border-color: var(--primary-color);
    background-color: rgba(0, 82, 255, 0.02);
}

/* Simple Checkbox */
.checkbox-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
}

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

/* File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-ui {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 32px 20px;
    text-align: center;
    background-color: var(--input-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.file-upload-wrapper:hover .file-upload-ui {
    border-color: var(--primary-color);
    background-color: rgba(0, 82, 255, 0.02);
}

.file-upload-ui svg {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.file-upload-ui span {
    font-weight: 600;
    color: var(--text-main);
}

.file-upload-ui small {
    color: var(--text-light);
}

.file-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #F3F4F6;
    border-radius: 6px;
    font-size: 13px;
}
.file-item button {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 16px;
}

/* Premium Estimate Box */
.premium-estimate {
    margin-top: 24px;
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border: 1px solid #BBF7D0;
    border-radius: var(--border-radius-sm);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: slideDown 0.3s ease-out forwards;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.estimate-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.estimate-content span {
    font-weight: 600;
    color: #166534;
}
.estimate-content strong {
    font-size: 20px;
    color: #15803D;
}
.estimate-note {
    font-size: 12px;
    color: #166534;
    opacity: 0.8;
}

/* Terms Box */
.terms-box {
    background-color: var(--input-bg);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    gap: 12px;
}

/* Footer Actions */
.form-actions {
    padding: 32px 40px;
    background-color: #F8FAFC;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.actions-wrapper {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    padding: 18px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    flex: 2;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: var(--input-bg);
}

.submit-note {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.customer-center {
    font-size: 13px;
    color: var(--text-light);
}
.contact-link {
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
}
.contact-link:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .app-container {
        margin: 30px auto 20px;
        padding: 0 16px;
    }
    .form-header h1 {
        font-size: clamp(20px, 5.8vw, 24px);
        white-space: nowrap;
        letter-spacing: -0.5px;
    }
    .subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    .section-header h2 {
        font-size: 20px;
    }
    .form-section {
        padding: 20px 16px;
    }
    .form-actions {
        padding: 20px 16px;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .checkbox-cards {
        grid-template-columns: 1fr;
    }
    .actions-wrapper {
        flex-direction: column;
    }
    .btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px;
    }
    .btn-secondary {
        order: 2;
    }
    .btn-primary {
        order: 1;
        margin-bottom: 8px;
    }
    .status-bar {
        transform: scale(0.85);
        margin-bottom: -10px;
    }
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Select2 Custom Styles */
.select2-container--default .select2-selection--single {
    height: 52px !important;
    padding: 13px 16px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    background-color: #FFFFFF !important;
    display: flex;
    align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 52px !important;
    right: 12px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    padding-left: 0 !important;
    color: var(--text-main) !important;
}
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.1) !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.btn-close-modal:hover {
    color: var(--text-main);
}

.modal-body p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
    color: var(--text-main);
}

.modal-body p strong {
    font-weight: 600;
    color: var(--text-sub);
}

.modal-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
}

.modal-list li {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
    color: var(--text-main);
}

.modal-list li:last-child {
    margin-bottom: 0;
}

.modal-list li strong {
    font-weight: 600;
    color: var(--text-sub);
}
