@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #FAF9F6;
    --bg-warm: #F5F3EE;
    --surface: #FFFFFF;
    --surface-hover: #FDFCFB;
    --text: #1A1814;
    --text-secondary: #5C5649;
    --text-muted: #9C9588;
    --accent: #C2710C;
    --accent-hover: #A85E08;
    --accent-subtle: #FEF7E8;
    --accent-border: #F5DFA8;
    --success: #2D7A4F;
    --success-bg: #ECFDF5;
    --success-border: #BBF7D0;
    --error: #C53030;
    --error-bg: #FEF2F2;
    --border: #E8E4DC;
    --border-strong: #D4CFC5;
    --shadow-sm: 0 1px 2px rgba(26, 24, 20, 0.04);
    --shadow-md: 0 4px 12px rgba(26, 24, 20, 0.06);
    --shadow-lg: 0 12px 40px rgba(26, 24, 20, 0.08);
    --shadow-xl: 0 24px 64px rgba(26, 24, 20, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(26, 24, 20, 0.03) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 249, 246, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}

header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--text);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.lang-switch:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--bg-warm);
}

.lang-switch .globe-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 8px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--success);
    margin-bottom: 28px;
    animation: fadeInDown 0.6s ease-out;
}

.hero-badge .shield-icon {
    width: 20px;
    height: 20px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(42px, 7vw, 68px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--text);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title .accent {
    color: var(--accent);
    position: relative;
}

.hero-title .accent::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.3;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 56px;
    line-height: 1.65;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.upload-section {
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, var(--accent-subtle) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone.drag-over {
    border-color: var(--accent);
    border-style: solid;
    background: var(--accent-subtle);
    transform: scale(1.01);
}

.upload-zone.drag-over::before {
    opacity: 1;
}

.upload-zone.processing {
    pointer-events: none;
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon {
    background: var(--accent-subtle);
    transform: translateY(-2px);
}

.upload-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.upload-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.upload-subtitle {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-display);
}

.upload-progress {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-progress.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-text {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

#file-input {
    display: none;
}

.result-section {
    display: none;
    margin-bottom: 60px;
    scroll-margin-top: 72px;
}

.result-section.visible {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.action-btn:hover {
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.action-btn.download.csv {
    background: #FEF3C7;
    border-color: #F5DFA8;
    color: #92400E;
}

.action-btn.download.csv:hover {
    background: #FDE68A;
    border-color: #F5DFA8;
}

.action-btn.download.xlsx {
    background: #DCFCE7;
    border-color: #BBF7D0;
    color: #166534;
}

.action-btn.download.xlsx:hover {
    background: #BBF7D0;
    border-color: #86EFAC;
}

.contact-count {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-warm);
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 500;
}

.search-bar {
    position: relative;
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s ease;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(194, 113, 12, 0.1);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.table-scroll {
    overflow-x: auto;
    max-height: 480px;
    overflow-y: auto;
}

.table-scroll table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-scroll th {
    background: var(--bg-warm);
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.table-scroll th:hover {
    background: #EDE9E0;
}

.table-scroll th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.3;
    font-size: 10px;
    transition: opacity 0.15s ease;
}

.table-scroll th.sorted .sort-icon {
    opacity: 1;
    color: var(--accent);
}

.table-scroll td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-display);
    font-weight: 400;
}

.table-scroll tr:last-child td {
    border-bottom: none;
}

.table-scroll tr:hover td {
    background: rgba(254, 247, 232, 0.3);
}

.table-scroll td a {
    color: var(--accent);
    text-decoration: none;
}

.table-scroll td a:hover {
    text-decoration: underline;
}

.table-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-warm);
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    gap: 4px;
}

.pagination button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination button:hover {
    border-color: var(--accent-border);
    background: var(--accent-subtle);
}

.pagination button.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.field-selector {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.field-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.field-selector-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.field-selector-actions {
    display: flex;
    gap: 8px;
}

.field-selector-actions button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: transparent;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.field-selector-actions button:hover {
    border-color: var(--accent-border);
    color: var(--accent);
}

.field-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: var(--surface);
}

.field-chip:hover {
    border-color: var(--accent-border);
}

.field-chip.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 500;
}

.field-chip .check {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.field-chip.active .check {
    background: var(--accent);
    border-color: var(--accent);
}

.field-chip.active .check::after {
    content: '';
    width: 6px;
    height: 3.5px;
    border-left: 1.5px solid white;
    border-bottom: 1.5px solid white;
    transform: rotate(-45deg) translateY(-0.5px);
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
}

.btn-reset:hover {
    border-color: var(--text);
    color: var(--text);
}

.features {
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.features-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.feature-icon.privacy { background: #DCFCE7; color: #166534; }
.feature-icon.speed { background: #FEF3C7; color: #92400E; }
.feature-icon.accurate { background: #E0E7FF; color: #3730A3; }
.feature-icon.free { background: #FCE7F3; color: #9D174D; }

.feature-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.feature-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.how-it-works {
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.how-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 40px;
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    counter-reset: step;
}

.how-step {
    text-align: center;
    position: relative;
}

.how-step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
}

.how-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 24px;
    left: calc(50% + 36px);
    width: calc(100% - 72px);
    height: 1px;
    background: var(--border-strong);
}

.how-step-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.how-step-desc {
    font-size: 13px;
    color: var(--text-muted);
}

footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-privacy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
    margin-bottom: 16px;
}

.footer-privacy svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.footer-copy {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    max-width: 90vw;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: var(--error);
    color: white;
}

.toast.success {
    background: var(--success);
    color: white;
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .hero {
        padding: 48px 0 40px;
    }

    .hero-title {
        font-size: clamp(32px, 8vw, 48px);
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .upload-zone {
        padding: 40px 24px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .how-steps {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .how-step:not(:last-child)::after {
        display: none;
    }

    .section-actions {
        width: 100%;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
        flex-direction: column;
        align-items: flex-start;
    }

    .table-scroll {
        max-height: 360px;
    }

    .field-grid {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    .header-inner {
        height: 56px;
    }
}
