:root {
    --primary: #3182f6; /* Toss Blue */
    --primary-hover: #1b64da;
    --bg-color: #f2f4f6;
    --card-bg: #ffffff;
    --text-main: #191f28;
    --text-sub: #8b95a1;
    --border: #e5e8eb;
}

body {
    margin: 0; padding: 0;
    font-family: 'Pretendard', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
}

body.policy-page {
    display: block;
    min-height: auto;
}

.app-container {
    width: 100%; max-width: 480px; height: 100vh; height: 100dvh;
    background-color: var(--card-bg);
    position: relative; overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.policy-shell {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 32px 24px 64px;
    box-sizing: border-box;
}

.policy-panel {
    background: var(--card-bg);
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow: hidden;
}

.policy-container {
    padding: 48px 56px 64px;
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.8;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.policy-container h1 {
    font-size: 36px;
    line-height: 1.25;
    font-weight: 800;
    margin: 0 0 32px;
    letter-spacing: -0.5px;
}

.policy-container h2 {
    font-size: 24px;
    line-height: 1.35;
    font-weight: 800;
    margin: 40px 0 18px;
    letter-spacing: -0.4px;
}

.policy-container p,
.policy-container li {
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.policy-container ul,
.policy-container ol {
    padding-left: 26px;
    margin: 0 0 20px;
}

.policy-container strong,
.policy-container b,
.policy-container .highlight {
    color: var(--text-main);
    font-weight: 700;
}

.back-btn {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
}

.step {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    padding: 30px 24px 0 24px; box-sizing: border-box;
    display: flex; flex-direction: column;
    transform: translateX(100%); opacity: 0;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    pointer-events: none; background-color: var(--card-bg); overflow-y: auto;
}
.step.active { transform: translateX(0); opacity: 1; pointer-events: all; }
.step.prev { transform: translateX(-50%); opacity: 0; }

.intro-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.icon-wrapper { font-size: 48px; margin-bottom: 20px; }
.intro-content h1 { font-size: 36px; font-weight: 800; line-height: 1.4; margin: 0 0 16px 0; letter-spacing: -0.5px; }
.intro-content p { font-size: 17px; color: var(--text-sub); line-height: 1.6; margin: 0; }
.intro-notice { font-size: 14px; color: var(--text-sub); text-align: center; margin-top: 24px; line-height: 1.5; font-weight: 500;}

.step-header { margin-bottom: 40px; }
.step-header.center { text-align: center; }
.step-indicator { font-size: 15px; font-weight: 700; color: var(--primary); display: block; margin-bottom: 12px; }
.step-header h2 { font-size: 28px; font-weight: 800; line-height: 1.4; margin: 0; letter-spacing: -0.5px; }
.subtitle { font-size: 16px; color: var(--text-sub); margin-top: 12px; line-height: 1.5; }

.hidden { display: none !important; }

/* Inputs */
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.input-group input[type="text"], .input-group input[type="date"], .input-group select, .input-group textarea {
    width: 100%; padding: 18px 20px; font-size: 17px; font-weight: 500; border: none;
    border-radius: 16px; box-sizing: border-box; background-color: var(--bg-color);
    color: var(--text-main); transition: all 0.2s; font-family: inherit; -webkit-appearance: none;
}
.input-group textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { outline: none; background-color: rgba(49, 130, 246, 0.05); box-shadow: inset 0 0 0 2px var(--primary); }

/* Phone Split */
.phone-inputs { display: flex; align-items: center; gap: 8px; }
.phone-prefix { font-size: 17px; padding: 18px 20px; background: var(--bg-color); border: none; border-radius: 16px; color: var(--text-main); font-weight: 600;}
.dash { color: var(--text-sub); }
.phone-inputs input[type="tel"] {
    flex: 1; padding: 18px 10px; font-size: 17px; font-weight: 500; text-align: center; border: none;
    border-radius: 16px; background-color: var(--bg-color); font-family: inherit; width: 100%; transition: all 0.2s;
}
.phone-inputs input[type="tel"]:focus { outline: none; background-color: rgba(49, 130, 246, 0.05); box-shadow: inset 0 0 0 2px var(--primary); }

/* Cards */
.card { background: #ffffff; border: none; border-radius: 20px; padding: 24px; margin-bottom: 24px; box-shadow: 0 8px 30px rgba(0,0,0,0.04); }
.card h3 { margin: 0 0 20px 0; font-size: 18px; font-weight: 700; color: var(--text-main); border-bottom: 1px solid var(--bg-color); padding-bottom: 16px;}
.card-description { font-size: 14px; color: var(--text-sub); line-height: 1.5; margin: -6px 0 18px 0; }

/* Clauses */
.clause-box { margin-bottom: 24px; }
.clause-item { display: flex; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--bg-color); }
.clause-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.clause-icon { font-size: 24px; }
.clause-text { flex: 1; }
.clause-text strong { display: block; font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text-main); }
.clause-text p { margin: 0; font-size: 14px; color: var(--text-sub); line-height: 1.5; }

/* Radios */
.radio-group { display: flex; gap: 12px; margin-top: 16px; }
.radio-card { flex: 1; cursor: pointer; }
.radio-card input { display: none; }
.radio-card .radio-text { display: block; text-align: center; padding: 16px; border: none; border-radius: 16px; font-size: 16px; font-weight: 700; color: var(--text-sub); background: var(--bg-color); transition: all 0.2s; }
.radio-card input:checked + .radio-text { color: var(--primary); background: rgba(49, 130, 246, 0.1); }

/* Canvas (Now full step) */
.signature-section { display: flex; flex-direction: column; flex: 1; margin-bottom: 24px;}
.sig-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 16px; font-weight: 800; color: var(--text-main); }
.canvas-container { 
    flex: 1; border: 2px dashed #e5e8eb; border-radius: 20px; 
    background-color: var(--bg-color); overflow: hidden; min-height: 300px;
    position: relative;
}
.canvas-container::before {
    content: '여기에 서명해 주세요';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px; font-weight: 700; color: #b0b8c1;
    pointer-events: none; z-index: 1;
}
canvas { width: 100%; height: 100%; touch-action: none; position: relative; z-index: 2; }

/* Buttons */
.button-group { 
    margin-top: auto; display: flex; gap: 12px; 
    padding: 24px 0 24px 0; 
    position: sticky; bottom: 0; background: var(--card-bg); z-index: 10;
}
button { font-family: inherit; cursor: pointer; border: none; }
.btn-primary { flex: 1; background-color: var(--primary); color: #fff; font-size: 18px; font-weight: 700; padding: 20px; border-radius: 18px; transition: background-color 0.2s; }
.btn-primary:active { background-color: var(--primary-hover); transform: scale(0.98); }
.btn-secondary { flex: 0.4; background-color: var(--bg-color); color: var(--text-main); font-size: 18px; font-weight: 700; padding: 20px; border-radius: 18px; transition: background-color 0.2s;}
.btn-secondary:active { background-color: #e5e8eb; transform: scale(0.98); }
.btn-text { background: none; color: var(--text-sub); font-size: 13px; font-weight: 600; padding: 6px; }
.download-btn { width: 100%; margin-top: 10px; box-shadow: 0 8px 16px rgba(49,130,246,0.2); }

/* Export Template (The actual document that gets saved) */
.export-template { background: #fff; padding: 30px 20px; border: 1px solid var(--border); color: #000; font-family: 'Pretendard', sans-serif; margin-top: 10px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.doc-header { text-align: center; margin-bottom: 25px; border-bottom: 2px solid #000; padding-bottom: 15px; }
.doc-title { font-size: 20px; font-weight: 800; margin: 0 0 10px 0; }
.doc-header p { font-size: 12px; margin: 0; color: #555; }
.doc-section { margin-bottom: 20px; }
.doc-sec-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #000; border-left: 3px solid #000; padding-left: 8px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.doc-table th, .doc-table td { border: 1px solid #ccc; padding: 8px; text-align: left; }
.doc-table th { background-color: #f9f9f9; width: 30%; }
.doc-clauses { font-size: 11px; padding-left: 20px; margin: 0 0 10px 0; line-height: 1.6; }
.doc-clauses li { margin-bottom: 6px; }
.doc-agree-text { font-size: 12px; font-weight: 600; text-align: center; margin-top: 15px; background: #f5f5f5; padding: 10px; border-radius: 4px; }
.doc-signatures { display: flex; justify-content: space-between; margin-top: 30px; gap: 10px; }
.doc-sig-box { flex: 1; border: 1px solid #ddd; padding: 10px; text-align: center; border-radius: 6px;}
.doc-sig-label { font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.doc-sig-box img { height: 45px; border-bottom: 1px solid #000; display: block; margin: 0 auto 10px auto; min-width: 80px; object-fit: contain; }
.doc-sig-name { font-size: 12px; font-weight: 500;}
.doc-footer { text-align: center; margin-top: 25px; font-size: 13px; font-weight: 700; }

/* SEO Content Section */
.seo-content { color: var(--text-main); line-height: 1.6; }
.seo-content h2 { font-size: 18px; font-weight: 800; margin-top: 30px; margin-bottom: 15px; letter-spacing: -0.5px;}
.seo-content p { font-size: 15px; color: var(--text-sub); margin-bottom: 16px; }
.seo-content ul, .seo-content ol { padding-left: 20px; font-size: 15px; color: var(--text-sub); margin-bottom: 20px;}
.seo-content li { margin-bottom: 8px; }
.seo-content strong { color: var(--text-main); font-weight: 700; }

.faq-item { background: rgba(49, 130, 246, 0.03); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.faq-item strong { display: block; font-size: 15px; margin-bottom: 6px; color: var(--text-main); }
.faq-item p { margin: 0; font-size: 14px; color: var(--text-sub); }

@media (max-width: 768px) {
    body.policy-page {
        background: var(--card-bg);
    }

    .policy-shell {
        width: 100%;
        padding: 0;
    }

    .policy-panel {
        border-radius: 0;
        box-shadow: none;
    }

    .policy-container {
        padding: 32px 24px 48px;
        max-width: none;
    }

    .policy-container h1 {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .policy-container h2 {
        font-size: 20px;
        margin-top: 32px;
        margin-bottom: 14px;
    }

    .policy-container p,
    .policy-container li {
        font-size: 16px;
    }

    .back-btn {
        font-size: 16px;
        margin-bottom: 22px;
    }
}
