/* ==========================================
   全体レイアウト・背景
   ========================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.reform-container {
    background: #ffffff;
    max-width: 680px;
    width: 100%;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* ==========================================
   見出し・テキスト
   ========================================== */
h1 {
    font-size: 24px;
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 700;
}

.reform-subtitle {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
}

/* ==========================================
   フォーム要素
   ========================================== */
.reform-form-group {
    margin-bottom: 20px;
}

.reform-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.reform-form-group input[type="number"],
.reform-form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #f8fafc;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.reform-form-group input[type="number"]:focus,
.reform-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ==========================================
   メイン計算ボタン
   ========================================== */
#calcBtn {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    margin-top: 10px;
}

#calcBtn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

#calcBtn:active {
    transform: translateY(0);
}

/* ==========================================
   結果表示エリア
   ========================================== */
.reform-hidden {
    display: none;
}

.reform-result-box {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed #e2e8f0;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.reform-result-box h2 {
    font-size: 18px;
    color: #1e293b;
    margin-bottom: 16px;
}

.reform-result-item {
    font-size: 15px;
    color: #334155;
    margin-bottom: 12px;
}

.reform-highlight-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
}

.reform-warning-text {
    color: #dc2626;
    font-weight: 700;
    font-size: 1.1em;
}

/* ==========================================
   詳細リスト・マクロ視点ボックス
   ========================================== */
.loss-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.loss-title {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
    margin-top: 0;
}

.loss-details-list {
    padding-left: 20px;
    margin-bottom: 0;
    font-size: 14px;
    color: #475569;
}

.loss-details-list li {
    margin-bottom: 8px;
}

.macro-perspective-box {
    background: #fdf4ff;
    border: 1px solid #f5d0fe;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.macro-title {
    font-weight: 600;
    font-size: 14px;
    color: #86198f;
    margin-top: 0;
}

.macro-text {
    font-size: 14px;
    color: #701a75;
    line-height: 1.5;
    margin-bottom: 0;
}

.reform-note {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 25px;
}

/* ==========================================
   モーダルウィンドウ用スタイル
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 35px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    color: #334155;
    text-align: left;
    line-height: 1.7;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-content h2, .modal-content h3 {
    color: #1e293b;
    margin-top: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.modal-content th, .modal-content td {
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
}

.modal-content th {
    background-color: #f8fafc;
    font-weight: 600;
}

/* 開閉式の詳細コンテンツ（初期状態は必ず非表示にする） */
.detail-content {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    background: #fff;
    border-left: 3px solid #3b82f6;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

/* クラス .show がついたときだけ表示する */
.detail-content.show {
    display: block;
}

/* 「具体的には」ボタンのスタイル */
.detail-btn {
    background: #e2e8f0;
    border: none;
    color: #334155;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 6px;
    transition: background 0.2s;
}

.detail-btn:hover {
    background: #cbd5e1;
}