/* Premium Design System for Towncar x Bakar */
:root {
    --primary: #FF6B35;
    --primary-dark: #E05220;
    --secondary: #FFB38A;
    --secondary-dark: #E79E78;
    --accent: #FF9E00;
    --bg-light: #FAF6F1;
    --bg-header: #FFF2E1;
    --bg-white: #ffffff;
    --text-main: #1A1512;
    --text-muted: #544840;
    --border: #F2E8DF;
    --shadow: 0 20px 40px rgba(255, 107, 53, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography Improvement */
h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.3;
}

h2 {
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
    color: var(--text-main);
    font-weight: 800;
}

h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 6px;
    background: var(--primary);
    margin: 20px auto 0;
    border-radius: 10px;
    opacity: 0.8;
}

/* Hero Section - Cleaner & Bright */
.hero {
    background-color: var(--bg-header);
    background-image: radial-gradient(at 0% 0%, rgba(255, 107, 53, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 107, 53, 0.05) 0, transparent 50%);
    color: var(--text-main);
    padding: 120px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    color: var(--text-main);
    font-weight: 800;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 48px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.btn-main {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 20px 60px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.25);
    transition: var(--transition);
}

.btn-main:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.35);
    background: var(--primary-dark);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--primary);
    padding: 20px 60px;
    border: 2px solid var(--primary);
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(255, 107, 52, 0.2);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Steps Section - Modern Cards */
.steps {
    padding: 100px 0;
    background: white;
}

.step-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.step-item {
    text-align: center;
    padding: 60px 30px;
    background: var(--bg-light);
    border-radius: 32px;
    transition: var(--transition);
    position: relative;
    border: none;
}

.step-item:hover {
    transform: translateY(-12px);
    background: white;
    box-shadow: 0 30px 60px rgba(255, 107, 53, 0.12);
}

.step-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--bg-header);
    color: var(--primary);
    border-radius: 24px;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 auto 30px;
    transition: var(--transition);
}

.step-item:hover span {
    background: var(--primary);
    color: white;
}

.step-item p {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.15rem;
    line-height: 1.4;
}

/* Coverage/Plan Section - High-end Table */
.coverage {
    padding: 100px 0;
    background: var(--bg-light);
}

.plan-table-wrapper {
    background: white;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.03);
    margin-top: 50px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-header);
    color: var(--primary);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

td:first-child {
    font-weight: 700;
    text-align: center;
    background: #fdfdfd;
    width: 250px;
    color: var(--text-main);
}

.cell-highlight {
    color: var(--primary);
    font-weight: 800;
    background: rgba(255, 107, 53, 0.05);
}

/* Form Section - Modern Inputs */
.form-section {
    padding: 100px 0;
    background: white;
}

.form-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px;
    background: var(--bg-white);
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(255, 107, 53, 0.1);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.label-row label {
    margin-bottom: 0;
}

.btn-plan-detail {
    font-size: 0.9rem;
    color: var(--primary);
    text-decoration: underline;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
}

.btn-plan-detail:hover {
    color: var(--primary-dark);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid var(--border);
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: #fdfdfd;
    color: var(--text-main);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'24'%20height%3D'24'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23FF6B35'%20stroke-width%3D'3'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpolyline%20points%3D'6%209%2012%2015%2018%209'%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 5px rgba(255, 107, 53, 0.1);
}

.file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #F9FBFB;
    border: 2px dashed var(--primary);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-height: 100px;
}

.file-upload:hover {
    background: var(--bg-header);
    border-color: var(--primary-dark);
}

.file-upload input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-upload span {
    display: block;
    max-width: 100%;
    padding: 0 15px;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 22px;
    font-size: 1.25rem;
    font-weight: 800;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.2);
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.3);
}

.required {
    color: #ff4d4f;
    margin-left: 4px;
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-search:hover {
    background: var(--primary-dark);
}

.coverage-checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    padding: 15px 25px;
    border-radius: 16px;
    margin-top: -10px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.coverage-checkbox-group label {
    margin-bottom: 0;
}

.segmented-control {
    display: flex;
    background: #F0F4F4;
    padding: 4px;
    border-radius: 12px;
    width: 160px;
    position: relative;
    user-select: none;
}

.segmented-item {
    flex: 1;
    position: relative;
    margin-bottom: 0 !important;
}

.segmented-item input[type="radio"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.segmented-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.segmented-item input[type="radio"]:checked+span {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* Agreement & Modal Styles */
.agreement-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    padding: 20px 25px;
    border-radius: 16px;
    margin-top: 15px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary);
    border: 2px solid var(--border);
    border-radius: 6px;
    margin: 0;
    transition: var(--transition);
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    user-select: none;
}

.btn-detail {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: underline;
    transition: var(--transition);
}

.btn-detail:hover {
    color: var(--primary);
}

/* Modal System */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 32px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin: 0;
}

.close {
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 10px 40px 20px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    white-space: pre-line;
    /* Ignores induction spaces but keeps line breaks */
    text-align: left;
    word-break: keep-all;
    overflow-wrap: anywhere;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 30px 40px 40px;
    text-align: center;
    flex-shrink: 0;
}

.btn-close-modal {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 50px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

/* Plan Modal Specific Constraints */
#planModal .modal-header {
    padding-top: 10px;
    padding-bottom: 10px;
}

#planModal .modal-body {
    padding-top: 0px;
    padding-bottom: 10px;
}

#planModal .modal-footer {
    padding-top: 15px;
    padding-bottom: 25px;
}

/* Coverage Detail Section */
.coverage-detail {
    padding: 100px 0;
    background: white;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 40px;
}

.detail-card {
    padding: 40px;
    background: var(--bg-light);
    border-radius: 32px;
    border-top: 6px solid var(--primary);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.detail-card:hover {
    transform: translateY(-8px);
    background: white;
    box-shadow: 0 20px 50px rgba(255, 107, 53, 0.08);
}

.detail-card h3 {
    margin-bottom: 24px;
    color: var(--text-main);
    font-size: 1.3rem;
}

.detail-card ul {
    list-style: none;
    padding-left: 0;
}

.detail-card li {
    margin-bottom: 18px;
    font-size: 1rem;
    position: relative;
    padding-left: 28px;
    color: var(--text-muted);
}

.detail-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 900;
}

/* 5. 자주 묻는 질문 (FAQ) */
.faq {
    padding: 80px 0 100px;
    background: var(--bg-light);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-white);
    border-radius: 16px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.08);
}

.faq-question {
    padding: 24px 30px;
    /* Increased padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.15rem;
    /* Increased font size */
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.faq-question .icon-arrow {
    width: 18px;
    height: 18px;
    position: relative;
    transition: transform 0.3s;
}

.faq-question .icon-arrow::before,
.faq-question .icon-arrow::after {
    content: "";
    position: absolute;
    background: var(--primary);
    border-radius: 2px;
}

.faq-question .icon-arrow::before {
    width: 2px;
    height: 10px;
    left: 8px;
    top: 4px;
}

.faq-question .icon-arrow::after {
    width: 10px;
    height: 2px;
    left: 4px;
    top: 8px;
}

.faq-item.active .faq-question .icon-arrow {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    opacity: 0;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.faq-item.active .faq-answer {
    padding: 0 25px 20px;
    max-height: 1000px; /* Increased to prevent content clipping */
    opacity: 1;
}

.faq-answer p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
}

/* Footer - Compact Version */
footer {
    background: #11181C;
    color: #E6EDF3;
    padding: 40px 0 30px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-top {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 30px;
}

.footer-logo {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.footer-heading {
    color: #fff;
    font-weight: 800;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.footer-links a {
    color: #8B949E;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-legal {
    background: rgba(255, 255, 255, 0.02);
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: #8B949E;
}

.footer-bottom {
    text-align: center;
    color: #484F58;
    padding-top: 15px;
    font-size: 0.75rem;
}

/* Address Field Redesign */
.address-row-top {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}

#postcode {
    flex: 0 0 115px;
    width: 115px;
}

#address {
    flex: 1;
}

.address-row-top .btn-search {
    flex: 0 0 100px;
    padding: 0 15px;
    height: 59px;
    border-radius: 16px;
    line-height: normal;
    font-weight: 700;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.address-row-top .btn-search:hover {
    background: var(--primary-dark);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .step-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {

    input,
    select,
    textarea {
        padding: 14px 18px;
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    select {
        background-position: right 14px center;
        background-size: 16px;
        padding-right: 40px;
    }

    th,
    td {
        padding: 14px 12px;
    }

    .btn-submit {
        padding: 16px;
        font-size: 1.1rem;
    }

    .agreement-group {
        word-break: keep-all;
    }

    .btn-detail {
        font-size: 0;
        text-decoration: none;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .btn-detail::after {
        content: '상세';
        font-size: 0.85rem;
        text-decoration: underline;
        color: var(--text-muted);
        transition: var(--transition);
    }

    .btn-detail:hover::after {
        color: var(--primary);
    }

    .checkbox-wrapper input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .checkbox-wrapper label {
        font-size: 0.85rem;
    }

    #planModal .modal-body {
        padding: 5px 15px 15px;
    }

    .hero {
        padding: 80px 20px;
    }

    .hero h1 {
        font-size: 2.4rem;
        margin-bottom: 20px;
    }

    .hero p {
        font-size: 1.15rem;
        margin-bottom: 36px;
    }

    .btn-main {
        padding: 18px 45px;
        font-size: 1.05rem;
    }

    .steps,
    .coverage,
    .form-section,
    .coverage-detail {
        padding: 60px 0;
    }

    .faq {
        padding: 60px 0 80px;
    }

    h2 {
        font-size: 1.9rem;
        margin-bottom: 40px;
    }

    .step-container {
        grid-template-columns: 1fr;
    }

    .plan-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 700px;
    }

    .form-card {
        padding: 40px 24px;
        border-radius: 32px;
    }

    .detail-grid {
        gap: 30px;
    }

    .faq-question {
        font-size: 1.05rem;
        padding: 20px 25px;
    }

    /* Mobile optimization for FAQ */

    /* Address Mobile Refinement */
    .address-row-top {
        flex-wrap: wrap;
    }

    #postcode {
        flex: 0 0 110px;
        width: 110px;
    }

    .address-row-top .btn-search {
        flex: 1;
        min-width: 80px;
        height: auto;
        padding: 14px 18px;
    }

    #address {
        flex: 1;
        min-width: 100%;
        order: 3;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.1rem;
    }

    .form-card {
        padding: 30px 20px;
    }
}