/* style.css - 高額療養費「最強の盾」安心チェッカー */

.bg-shield {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* 病院の清潔感・不安から、絶対的なシールド（青と緑）の安心感へのグラデーション */
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 30%, #38bdf8 60%, #0ea5e9 100%);
    background-size: 300% 300%;
    animation: shieldAura 15s ease infinite;
    z-index: -1;
}

@keyframes shieldAura {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    color: #1e293b;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
}

.sim-container {
    width: 100%;
    max-width: 800px;
    padding: 60px 20px 40px;
    position: relative;
    z-index: 10;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #0284c7;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.back-link:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.main-app-card.shield-app-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 3px solid #7dd3fc;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(2, 132, 199, 0.2), inset 0 0 20px rgba(255, 255, 255, 1);
}

.sim-header {
    text-align: center;
    margin-bottom: 2rem;
}

.sim-header h2 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #0284c7, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.sim-header p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}
.sim-header p strong {
    color: #059669;
}

/* 入力エリア */
.input-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e0f2fe;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 20px;
}
.grid-inputs:last-child { margin-bottom: 0; }

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1e293b;
    font-size: 0.95rem;
}

.highlight-val {
    font-size: 1.4rem;
    font-weight: 900;
    color: #0369a1;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: #bae6fd;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 4px solid #0284c7;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ラジオボタン 収入UI */
.income-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-card {
    cursor: pointer;
    flex: 1;
    min-width: 90px;
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 10px 5px;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.radio-card input[type="radio"]:checked + .radio-label {
    background: #f0fdf4;
    border-color: #10b981;
    color: #047857;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
}

.sub-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 8px;
}

/* 視覚的アリーナ (シールドバー) */
.visual-section {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.shield-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    color: #334155;
}

.shield-title span {
    color: #0369a1;
    font-size: 1.2rem;
    font-weight: 900;
}

.shield-bar-wrapper {
    width: 100%;
    height: 40px;
    background: #e2e8f0;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.bar-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-gov { background: #94a3b8; } /* グレー（国が負担する7割） */
.segment-shield { 
    background: linear-gradient(90deg, #10b981, #059669); 
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3);
} /* 緑の盾（高額療養費免除） */
.segment-net { background: #ef4444; } /* 赤：避けられないガチ自己負担 */

/* 特に自己負担が小さいことを強調するためのボーダー */
.segment-net {
    border-left: 2px solid #fff;
}

.breakdown-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 0.9rem;
    color: #475569;
}

.bd-item strong {
    color: #64748b;
    font-size: 1.1rem;
}

.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot-gov { background: #94a3b8; }
.dot-shield { background: #10b981; }

/* 結果セクション */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 20px;
}

.stat-box {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.stat-title {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: bold;
    line-height: 1.4;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
}

.danger { color: #dc2626; opacity: 0.6; }

/* 3割負担の無効化（打消し線） */
.strike-line {
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 4px;
    background: #dc2626;
    transform: rotate(-10deg);
    opacity: 0;
    transition: opacity 0.5s ease 0.5s;
}

.net-box {
    background: rgba(236, 253, 245, 0.8);
    border-color: #10b981;
    border-style: solid;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}
.net-box .stat-value.highlight {
    color: #047857; /* 最終決定された負担額の深緑 */
    font-size: 2.2rem;
}

.final-verdict {
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.final-verdict h3 {
    margin-bottom: 10px;
    color: #0f172a;
}

.final-verdict p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

/* 安心・シールド発生スタイル */
.verdict-safe {
    border-color: #10b981;
    background: rgba(209, 250, 229, 0.4);
}
.verdict-safe h3 { color: #047857; }

@media (max-width: 650px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
