:root {
    --bg: #ffffff;
    --bg-soft: #f8f9fa;
    --surface: #ffffff;
    --text: #2d3748;
    --text-muted: #718096;
    --primary: #6b1dbf;
    --border-subtle: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Josefin Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 120px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.logo-container {
    text-align: center;
    padding: 32px 20px;
    margin-bottom: 24px;
}

.logo-container a {
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo-container a:hover {
    opacity: 0.8;
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    height: 80px;
    background: var(--bg-soft);
    border: 2px dashed var(--border-subtle);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.logo-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#calculator-screen .header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

#calculator-screen .header h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

#calculator-screen .header p {
    font-size: clamp(16px, 3vw, 20px);
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

.card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    padding: clamp(24px, 5vw, 48px);
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.step-section {
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
}

.step-section:last-of-type {
    border-bottom: none;
    margin-bottom: 40px;
}

#calc-btn {
    margin-top: 24px;
    display: block !important;
    visibility: visible !important;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.section-title {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.helper-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.product-card {
    background: var(--bg-soft);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.15);
}

.product-card.active {
    border-color: var(--primary);
    background: rgba(107, 29, 191, 0.05);
}

.product-card.active::before {
    content: "✓";
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.product-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.product-card:hover .product-icon,
.product-card.active .product-icon {
    color: var(--primary);
}

.product-icon svg {
    width: 100%;
    height: 100%;
}

.product-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    padding-right: 30px;
}

.product-card .product-tagline {
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-card .product-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.product-card .product-helper {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0;
    opacity: 0.8;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

input[type="number"],
input[type="email"],
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text);
    transition: all 0.2s ease;
    font-family: "Josefin Sans", sans-serif;
}

input[type="number"]:focus,
input[type="email"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

input.error {
    border-color: #ef4444;
}

.error-text {
    color: #ef4444;
    font-size: 14px;
    margin-top: 6px;
    display: none;
}

.error-text.show {
    display: block;
}

.info-box {
    background: var(--bg-soft);
    border-left: 3px solid var(--primary);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
}

.info-box p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 28px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    background: var(--primary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Josefin Sans", sans-serif;
    position: relative;
    z-index: 10;
}

.button-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(107, 29, 191, 0.3);
}

.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-primary:disabled:hover {
    filter: none;
    transform: none;
    box-shadow: none;
}

.button-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border-subtle);
    margin-top: 12px;
}

.button-secondary:hover {
    background: var(--bg-soft);
    filter: none;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.email-screen {
    text-align: center;
}

.email-screen h2 {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.email-screen > p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.email-form {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.privacy-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 16px;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-header h2 {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    color: var(--text);
}

.result-header .selected-products {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.big-result {
    background: rgba(107, 29, 191, 0.05);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: clamp(32px, 5vw, 48px);
    text-align: center;
    margin-bottom: 32px;
}

.big-number {
    font-size: clamp(40px, 10vw, 64px);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.big-label {
    font-size: clamp(16px, 3vw, 20px);
    color: var(--text);
    font-weight: 600;
    margin-bottom: 4px;
}

.big-sublabel {
    font-size: 14px;
    color: var(--text-muted);
}

.range-explanation {
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: center;
}

.range-explanation p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.range-explanation strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 15px;
}

.product-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.product-result-card {
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
}

.product-result-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.product-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    gap: 16px;
}

.product-stat .label {
    color: var(--text-muted);
    flex: 1;
}

.product-stat .value {
    color: var(--text);
    font-weight: 600;
    text-align: right;
}

.funnel-container {
    background: var(--bg-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: clamp(24px, 4vw, 32px);
    margin-bottom: 32px;
}

.funnel-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.funnel-item:last-child {
    margin-bottom: 0;
}

.funnel-number {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.funnel-box {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    padding: 20px 24px;
    border-radius: 12px;
}

.funnel-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.funnel-value {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.funnel-arrow {
    text-align: center;
    color: var(--text-muted);
    font-size: 24px;
    margin: 4px 0 4px 22px;
    opacity: 0.5;
}

.insights-section {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: clamp(24px, 4vw, 32px);
    margin-bottom: 24px;
}

.insights-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

.insights-section ul {
    list-style: none;
}

.insights-section li {
    padding: 12px 0 12px 48px;
    color: var(--text-muted);
    position: relative;
    line-height: 1.6;
}

.insights-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 20px;
}

.insights-section li.with-icon::before {
    display: none;
}

.insights-section li.with-icon .icon {
    position: absolute;
    left: 0;
    top: 12px;
    width: 32px;
    height: 32px;
}

.insights-section li.with-icon .icon svg {
    width: 100%;
    height: 100%;
}

.insights-section li.with-icon .icon svg path,
.insights-section li.with-icon .icon svg circle {
    stroke: var(--primary);
}

.insights-section li.with-icon .icon svg path[fill]:not([fill="none"]),
.insights-section li.with-icon .icon svg circle[fill]:not([fill="none"]) {
    fill: var(--primary);
}

.insights-section strong {
    color: var(--text);
}

.cta-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.cta-container .button-primary,
.cta-container .button-outline {
    width: 100%;
}

.button-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 28px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary);
    background: var(--surface);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Josefin Sans", sans-serif;
}

.button-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.2);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text);
}

.modal-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.modal-description {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 16px;
}

.zcal-inline-widget {
    min-height: 500px;
}

@media (max-width: 768px) {
    body {
        padding: 16px;
        padding-bottom: 150px;
    }

    .logo-container {
        padding: 24px 16px;
    }

    .card {
        padding: 24px 20px;
        padding-bottom: 80px;
    }

    .step-section {
        margin-bottom: 40px;
        padding-bottom: 32px;
    }

    .step-header {
        gap: 12px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .step-section:last-of-type {
        margin-bottom: 32px;
    }

    #calc-btn {
        margin-top: 32px;
        margin-bottom: 40px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-breakdown {
        grid-template-columns: 1fr;
    }

    .funnel-container {
        padding: 20px 16px;
    }

    .funnel-item {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 16px;
    }

    .funnel-number {
        margin-bottom: 0;
        margin-right: 12px;
        width: 36px;
        height: 36px;
        font-size: 16px;
        min-width: 36px;
    }

    .funnel-box {
        padding: 16px 18px;
    }

    .funnel-label {
        font-size: 11px;
    }

    .funnel-value {
        font-size: 20px;
        line-height: 1.3;
        word-break: break-word;
    }

    .funnel-arrow {
        margin-left: 18px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .button-primary {
        padding: 12px 24px;
        font-size: 15px;
    }

    .range-explanation {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-stat {
        flex-direction: column;
        gap: 4px;
    }

    .product-stat .value {
        text-align: left;
    }

    .modal-content {
        padding: 32px 24px;
    }
}
