/* ============================================
   Toner Cost Calculator — High Conversion Theme
   ============================================ */

:root {
    --bg-light: #f1f5f9;
    --bg-card: #ffffff;
    --border: #cbd5e1;
    --border-active: #1e40af;
    /* 信頼の濃紺 */

    --text: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --primary: #1e3a8a;
    /* メインカラー（ネイビー） */
    --accent: #16a34a;
    /* 成功・削減（グリーン） */
    --accent-hover: #15803d;
    --highlight: #dc2626;
    /* 強調（赤） */

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --radius: 8px;
    --radius-lg: 16px;
    --font: 'Inter', 'Noto Sans JP', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

.sp-only {
    display: none;
}

@media (max-width: 640px) {
    .sp-only {
        display: inline;
    }
}

.hidden {
    display: none !important;
}

/* Hero with Pattern */
.hero {
    position: relative;
    padding: 40px 0 32px;
    text-align: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-block;
    background: #dbeafe;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.hero-sub strong {
    color: var(--highlight);
    background: linear-gradient(transparent 70%, #fecaca 70%);
}

/* Simulator Card */
.simulator-section {
    padding-bottom: 64px;
}

.simulator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    box-shadow: var(--shadow-lg);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 40px;
    position: relative;
}

.progress-bar-bg {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    position: relative;
    top: 14px;
    z-index: 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    /* JS controlled */
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.progress-step {
    background: #fff;
    border: 2px solid #e2e8f0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}

.progress-step.active {
    border-color: var(--accent);
    color: var(--accent);
    background: #f0fdf4;
}

/* Step Header */
.step {
    animation: fadeIn 0.4s ease;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50%;
}

.step-header h2 {
    font-size: 18px;
    font-weight: 700;
}

/* Grids */
.maker-grid,
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.maker-btn,
.model-btn {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.maker-btn:hover,
.model-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.maker-btn.active,
.model-btn.active {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
}

.maker-btn.active::after,
.model-btn.active::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Step 3: Inputs & Slider */
.input-display-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.input-display-wrapper input {
    width: 140px;
    text-align: right;
    font-size: 32px;
    font-weight: 800;
    border: none;
    border-bottom: 2px solid var(--border);
    color: var(--primary);
    font-family: var(--font);
    padding: 4px;
    transition: border 0.2s;
}

.input-display-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
}

.range-slider-wrapper {
    max-width: 400px;
    margin: 0 auto 24px;
}

input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: grab;
    margin-top: -10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 2px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.preset-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.preset-btn {
    background: #f1f5f9;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn.active {
    background: #dcfce7;
    color: var(--accent);
    border-color: #86efac;
}

.calc-action {
    text-align: center;
}

.calc-button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 18px 48px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.calc-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(22, 163, 74, 0.4);
}

.back-link {
    text-align: center;
    margin-top: 24px;
}

.back-link a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* ================= Result Graph Section ================= */
.chart-section {
    margin: 24px 0 40px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.chart-row {
    margin-bottom: 20px;
}

.chart-row:last-child {
    margin-bottom: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.chart-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
}

.chart-value {
    font-weight: 800;
    font-size: 18px;
}

.bar-bg {
    height: 36px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* Genuine Style */
.row-genuine .chart-label {
    color: var(--text-muted);
}

.row-genuine .chart-value {
    color: var(--text);
}

.row-genuine .bar-fill {
    background: #94a3b8;
}

/* Ecotte Style */
.row-ecotte .chart-label {
    color: var(--accent);
}

.row-ecotte .chart-value {
    color: var(--accent);
    font-size: 24px;
}

.row-ecotte .bar-fill {
    background: var(--accent);
    box-shadow: 0 0 15px rgba(22, 163, 74, 0.4);
}

/* Saving Highlight */
.saving-highlight {
    text-align: center;
    margin-bottom: 24px;
}

.saving-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.highlight-text {
    color: var(--highlight);
    font-size: 20px;
}

.saving-amount {
    display: inline-block;
    background: #fef2f2;
    color: var(--highlight);
    border: 2px solid #fecaca;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 18px;
    animation: popIn 0.6s 0.5s both cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.saving-amount .amount {
    font-size: 28px;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Detail Table Toggle */
.detail-toggle {
    text-align: center;
    margin-bottom: 24px;
}

.detail-toggle button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.detail-table th,
.detail-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.detail-table th:nth-child(3) {
    color: var(--accent);
    background: #f0fdf4;
}

.detail-table td:nth-child(3) {
    font-weight: 700;
    background: #f0fdf4;
}

/* CTA */
.cta-section {
    text-align: center;
    padding-top: 32px;
    border-top: 1px dashed var(--border);
}

.cta-message {
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 16px;
}

.cta-button {
    display: inline-block;
    background: var(--highlight);
    /* 赤で強く訴求 */
    color: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    transition: transform 0.2s;
}

.cta-button:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

/* Pulse Animation for CTA */
.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.reset-button {
    display: block;
    margin: 20px auto 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
}

/* Trust Banner */
.trust-corp-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.logo-text {
    font-weight: 800;
    font-size: 24px;
    color: var(--accent);
    line-height: 1;
}

.logo-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.corp-features {
    display: flex;
    gap: 24px;
}

.corp-feature {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-text {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .simulator-card {
        padding: 24px 20px;
    }

    .trust-corp-banner {
        flex-direction: column;
        text-align: center;
    }

    .corp-features {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-value {
        align-self: flex-end;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}