/* style.css - フリーランス「手取り激減」リアルチェッカー */

.bg-tax {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* お役所や税金の手紙を意識しながらも、冷徹でサイバーなスチールブルーグラデーション */
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0c4a6e 100%);
    background-size: 300% 300%;
    animation: coldSteel 20s ease infinite;
    z-index: -1;
}

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

body {
    color: #f1f5f9;
    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: #93c5fd;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 100;
    border: 1px solid rgba(147, 197, 253, 0.3);
    transition: all 0.3s ease;
}
.back-link:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
}

.main-app-card.tax-app-card {
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 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, #1d4ed8, #0ea5e9);
    -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;
}

/* 入力エリア */
.input-section {
    background: rgba(241, 245, 249, 0.6);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

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

.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: #cbd5e1;
    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);
}

/* トグルスイッチ */
.options-box {
    background: #fff;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    display: inline-block;
}

.toggle-control {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-control input {
    display: none;
}

.control-indicator {
    width: 48px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
    margin-right: 12px;
}

.control-indicator::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-control input:checked ~ .control-indicator {
    background: #0ea5e9;
}

.toggle-control input:checked ~ .control-indicator::after {
    transform: translateX(24px);
}

.control-label {
    font-size: 0.95rem;
    font-weight: bold;
    color: #475569;
}

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

.tax-bar-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: #334155;
}

.tax-bar-title span {
    color: #1d4ed8;
    font-size: 1.2rem;
    font-weight: 900;
}

.tax-bar-wrapper {
    width: 100%;
    height: 36px;
    background: #f1f5f9;
    border-radius: 18px;
    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.8rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.5s ease;
}

.segment-expense { background: #94a3b8; } /* グレー */
.segment-tax { background: repeating-linear-gradient(45deg, #f87171, #f87171 10px, #ef4444 10px, #ef4444 20px); } /* 赤警告 */
.segment-net { background: linear-gradient(90deg, #10b981, #059669); } /* 緑手取り */

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

.bd-item strong {
    color: #dc2626;
    font-size: 1rem;
}

.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot-tax { background: #ef4444; }

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

.stat-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    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;
}

.stat-value {
    font-size: 1.8rem;
    color: #334155;
    font-weight: 900;
}

.stat-value.danger { color: #dc2626; font-size: 2rem;}

.net-box {
    background: rgba(236, 253, 245, 0.6);
    border-color: #34d399;
}
.net-box .stat-value.highlight {
    color: #059669;
    font-size: 2.2rem;
}

.monthly-net {
    font-size: 0.9rem;
    color: #475569;
    font-weight: bold;
    margin-top: 5px;
}
.monthly-net span {
    font-size: 1.1rem;
    color: #059669;
}

.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-hell {
    border-color: #ef4444;
    background: rgba(254, 226, 226, 0.4);
}
.verdict-hell h3 { color: #b91c1c; }

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