/* ============================================
   도배 견적 비교 - Complete Stylesheet
   Mobile-first responsive design
   ============================================ */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1B5E20;
    --primary-light: #2E7D32;
    --primary-dark: #0D3B13;
    --primary-bg: #E8F5E9;
    --accent: #F57C00;
    --accent-light: #FF9800;
    --accent-dark: #E65100;
    --danger: #D32F2F;
    --info: #1976D2;
    --success: #388E3C;
    --warning: #FFA000;
    --bg: #F5F5F5;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --text: #212121;
    --text-secondary: #616161;
    --text-light: #9E9E9E;
    --text-white: #FFFFFF;
    --border: #E0E0E0;
    --border-light: #F0F0F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --header-height: 56px;
    --tab-height: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--header-height) + var(--safe-top));
    padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 100%;
}

/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding-top: var(--safe-top);
    height: calc(var(--header-height) + var(--safe-top));
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 16px;
    max-width: 960px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 17px;
    color: var(--primary);
}

.logo-icon { font-size: 22px; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text);
    transition: background 0.2s;
}

.header-btn:hover { background: var(--bg); }
.header-phone { color: var(--primary); }

/* ===== SIDE MENU ===== */
.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.side-menu-overlay.open { opacity: 1; visibility: visible; }

.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--bg-white);
    z-index: 2001;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

.side-menu.open { right: 0; }

.side-menu-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.side-menu-close {
    margin-left: auto;
    font-size: 28px;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-menu-list {
    list-style: none;
    padding: 8px 0;
}

.side-menu-list a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s;
}

.side-menu-list a:hover,
.side-menu-list a.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

.menu-divider {
    padding: 12px 20px 4px;
}

.menu-divider span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.side-menu-contact {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.menu-contact-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: var(--primary);
    color: var(--text-white);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
}

/* ===== TAB BAR ===== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(var(--tab-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.tab-item.active { color: var(--primary); }
.tab-item.active svg { stroke: var(--primary); }

.tab-item-cta { flex: 1.3; }

.tab-cta-circle {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.4);
}

.tab-cta-circle svg { stroke: white; }
.tab-item-cta span { color: var(--accent); font-weight: 700; }

/* ===== FLOATING CTA ===== */
.floating-cta {
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
    right: 16px;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
}

.floating-cta.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.floating-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(245, 124, 0, 0.4);
    white-space: nowrap;
}

.pulse-anim { animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 4px 20px rgba(245, 124, 0, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(245, 124, 0, 0.6), 0 0 0 8px rgba(245, 124, 0, 0.1); }
    100% { box-shadow: 0 4px 20px rgba(245, 124, 0, 0.4); }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 70px);
    right: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 998;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 40px 16px 20px;
    margin-bottom: calc(var(--tab-height) + var(--safe-bottom));
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
}

.footer-brand { margin-bottom: 24px; }

.footer-logo {
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.footer-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.footer-col a {
    display: block;
    font-size: 12px;
    color: #999;
    padding: 3px 0;
    transition: color 0.2s;
}

.footer-col a:hover { color: #4CAF50; }

.footer-social {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.social-link:hover { opacity: 0.8; }
.social-naver { background: #03C75A; color: white; }
.social-youtube { background: #FF0000; color: white; }
.social-phone { background: var(--primary); color: white; }

.footer-biz {
    padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.footer-biz p {
    font-size: 11px;
    color: #777;
    line-height: 1.8;
}

.footer-copy {
    text-align: center;
}

.footer-copy p {
    font-size: 11px;
    color: #666;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: white;
    padding: 40px 16px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero h1 {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 12px;
    position: relative;
}

.hero-sub {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 24px;
    line-height: 1.5;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-size: 24px;
    font-weight: 900;
    color: #FFD54F;
}

.hero-stat-label {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 4px 20px rgba(245, 124, 0, 0.5);
    animation: pulse 2s infinite;
    transition: transform 0.2s;
}

.hero-cta:active { transform: scale(0.96); }

.hero-fomo {
    margin-top: 16px;
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fomo-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: blink-dot 1.5s infinite;
}

@keyframes blink-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== SECTION COMMON ===== */
.section {
    padding: 32px 16px;
    max-width: 960px;
    margin: 0 auto;
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-icon { font-size: 24px; }

.section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ===== AD SPACE ===== */
.ad-space {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin: 24px 16px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 12px;
}

/* ===== QUICK ACTIONS GRID ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px;
    max-width: 960px;
    margin: -24px auto 0;
    position: relative;
    z-index: 10;
}

.quick-action {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.quick-action:active { transform: scale(0.95); }

.quick-action-icon {
    font-size: 28px;
    margin-bottom: 6px;
    display: block;
}

.quick-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 20px; }

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

/* Calculator Cards - horizontal scroll */
.calc-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 16px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 992px;
    margin: 0 auto;
}

.calc-scroll::-webkit-scrollbar { display: none; }

.calc-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.calc-card:hover,
.calc-card:focus { border-color: var(--primary); box-shadow: var(--shadow-md); }

.calc-card-icon { font-size: 36px; margin-bottom: 8px; }

.calc-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.calc-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.calc-card-badge {
    display: inline-block;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
}

/* ===== GUIDE CARDS ===== */
.guide-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-item {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.guide-item:hover { box-shadow: var(--shadow-md); }

.guide-item-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.guide-item-text { flex: 1; min-width: 0; }

.guide-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== FOMO BANNER ===== */
.fomo-banner {
    background: linear-gradient(90deg, #FFF3E0, #FFF8E1);
    border-left: 4px solid var(--accent);
    padding: 14px 16px;
    margin: 0 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 928px;
    margin-left: auto;
    margin-right: auto;
}

.fomo-banner-icon { font-size: 28px; flex-shrink: 0; }

.fomo-banner-text {
    flex: 1;
}

.fomo-banner-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-dark);
}

.fomo-banner-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== CALCULATOR PAGE ===== */
.calc-page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 24px 16px;
    text-align: center;
}

.calc-page-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.calc-page-header p {
    font-size: 13px;
    opacity: 0.9;
}

.calc-form {
    padding: 20px 16px;
    max-width: 640px;
    margin: 0 auto;
}

.calc-group {
    margin-bottom: 20px;
}

.calc-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.calc-label-hint {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Option buttons (radio-style) */
.calc-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.calc-option {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.calc-option:hover { border-color: var(--primary-light); }

.calc-option.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.calc-option-full { min-width: calc(33.333% - 6px); }

/* Input fields */
.calc-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text);
    background: var(--bg-white);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.calc-input:focus {
    outline: none;
    border-color: var(--primary);
}

.calc-input-with-unit {
    display: flex;
    align-items: center;
}

.calc-input-with-unit .calc-input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: none;
}

.calc-unit {
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Calculate button */
.calc-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.calc-btn:hover { background: var(--primary-dark); }
.calc-btn:active { transform: scale(0.98); }

.calc-btn-accent {
    background: var(--accent);
}

.calc-btn-accent:hover { background: var(--accent-dark); }

/* Result area */
.calc-result {
    display: none;
    margin-top: 24px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.calc-result.show { display: block; }

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

.calc-result-header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    text-align: center;
}

.calc-result-total {
    font-size: 28px;
    font-weight: 900;
}

.calc-result-range {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.calc-result-body { padding: 20px; }

.calc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.calc-result-row:last-child { border-bottom: none; }

.calc-result-label { color: var(--text-secondary); }

.calc-result-value {
    font-weight: 700;
    color: var(--text);
}

.calc-result-highlight {
    background: #FFF3E0;
    margin: 12px -20px;
    padding: 12px 20px;
}

.calc-result-highlight .calc-result-value { color: var(--accent-dark); }

/* Result tips */
.calc-tips {
    margin-top: 16px;
    padding: 16px;
    background: var(--primary-bg);
    border-radius: var(--radius-md);
}

.calc-tips-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.calc-tips li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding-left: 16px;
    position: relative;
    list-style: none;
}

.calc-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Result CTA */
.calc-result-cta {
    margin-top: 20px;
    text-align: center;
}

.calc-result-cta a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(245,124,0,0.3);
    transition: transform 0.2s;
}

.calc-result-cta a:active { transform: scale(0.96); }

/* ===== COMPARISON TABLE ===== */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 16px 0;
}

.compare-table th,
.compare-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.compare-table th {
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.compare-table th:first-child { text-align: left; }
.compare-table td:first-child { text-align: left; font-weight: 600; }

.compare-table tr:nth-child(even) { background: var(--bg); }

.compare-winner { color: var(--primary); font-weight: 700; }

/* ===== ESTIMATE FORM ===== */
.estimate-form {
    padding: 20px 16px;
    max-width: 640px;
    margin: 0 auto;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.form-required {
    color: var(--danger);
    font-size: 12px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text);
    background: var(--bg-white);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text);
    background: var(--bg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 16px center;
    -webkit-appearance: none;
    appearance: none;
}

.form-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.form-option-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-option-btn.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

/* Privacy checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.form-checkbox-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.form-checkbox-link {
    color: var(--info);
    text-decoration: underline;
    cursor: pointer;
}

/* Submit button */
.form-submit {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
}

.form-submit:hover { background: var(--accent-dark); }
.form-submit:disabled { background: #ccc; cursor: not-allowed; }

/* File upload */
.form-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    background: var(--bg);
}

.form-upload:hover { border-color: var(--primary); }

.form-upload-icon { font-size: 32px; margin-bottom: 8px; }

.form-upload-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.form-upload input[type="file"] { display: none; }

/* Success message */
.form-success {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.form-success.show { display: block; }

.form-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.form-success h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.form-success p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== PRIVACY POPUP / MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal-box {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
    border-radius: 50%;
}

.modal-close:hover { background: var(--bg); }

.modal-body {
    padding: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-body h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 16px 0 8px;
}

.modal-body h4:first-child { margin-top: 0; }

.modal-body ul {
    padding-left: 20px;
    margin: 8px 0;
}

.modal-body li { margin-bottom: 4px; }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.modal-footer .form-checkbox {
    flex: 1;
}

.modal-btn-agree {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.modal-btn-agree:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== GUIDE/ARTICLE PAGE ===== */
.article-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 24px 16px;
}

.article-header h2 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
}

.article-meta {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.article-body {
    padding: 24px 16px;
    max-width: 720px;
    margin: 0 auto;
}

.article-body h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin: 28px 0 12px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

.article-body h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 8px;
}

.article-body p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.article-body ul, .article-body ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article-body li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 4px;
}

.article-body strong { color: var(--text); }

.article-body .info-box {
    background: #E3F2FD;
    border-left: 4px solid var(--info);
    padding: 14px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #1565C0;
}

.article-body .warning-box {
    background: #FFF3E0;
    border-left: 4px solid var(--warning);
    padding: 14px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #E65100;
}

.article-body .tip-box {
    background: var(--primary-bg);
    border-left: 4px solid var(--primary);
    padding: 14px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--primary-dark);
}

/* Price table in articles */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.price-table th,
.price-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.price-table th {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.price-table tr:nth-child(even) { background: #FAFAFA; }
.price-table td:first-child { text-align: left; font-weight: 600; }

/* ===== ABOUT PAGE ===== */
.about-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 32px 16px;
    text-align: center;
}

.about-hero h2 {
    font-size: 24px;
    font-weight: 900;
}

.about-hero p {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* ===== PRIVACY/TERMS PAGE ===== */
.legal-page {
    padding: 24px 16px;
    max-width: 720px;
    margin: 0 auto;
}

.legal-page h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text);
}

.legal-page h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 8px;
    color: var(--text);
}

.legal-page p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-page ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.legal-page li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 4px;
}

/* ===== 404 PAGE ===== */
.page-404 {
    text-align: center;
    padding: 80px 20px;
}

.page-404-icon { font-size: 64px; margin-bottom: 16px; }

.page-404 h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-404 p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.page-404 a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-light);
    max-width: 960px;
    margin: 0 auto;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 4px; }

/* ===== RELATED CALCS ===== */
.related-calcs {
    padding: 20px 16px;
    max-width: 960px;
    margin: 0 auto;
}

.related-calcs h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 600;
}

.related-item-icon { font-size: 20px; }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .hero h1 { font-size: 36px; }
    .hero-sub { font-size: 17px; }
    .quick-actions { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .footer-links { grid-template-columns: repeat(3, 1fr); }
    .calc-option { min-width: auto; flex: 1; }
    .form-option-btn { min-width: auto; flex: 1; }
    .related-grid { grid-template-columns: repeat(4, 1fr); }
    .guide-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    :root {
        --header-height: 64px;
    }

    .header-inner { padding: 0 24px; }

    .hero { padding: 60px 24px 72px; }
    .hero h1 { font-size: 40px; }

    .section { padding: 40px 24px; }
    .quick-actions { gap: 20px; margin-top: -32px; }

    .tab-bar { display: none; }
    .app-container { padding-bottom: 0; }

    .floating-cta { bottom: 24px; }
    .back-to-top { bottom: 80px; }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    z-index: 5000;
    opacity: 0;
    transition: all 0.3s;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== REGION PRICE TABLE ===== */
.region-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 12px;
}

.region-table th, .region-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.region-table th {
    background: #F5F5F5;
    font-weight: 700;
    color: var(--text);
}

.region-table td:first-child { text-align: left; }

/* ===== ESTIMATE COUNTER (FOMO) ===== */
.live-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.live-counter-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: blink-dot 1s infinite;
}

.live-counter-num {
    font-weight: 800;
    color: var(--accent);
}
