/* style.css */
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 800px; 
    margin: 0 auto; 
    padding: 0 10px; 
    background-color: #fdfdfd;
}

.site-header {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    text-align: center;
}
.site-footer {
    padding: 30px 0;
    border-top: 1px solid #eee;
    margin-top: 40px;
    text-align: center;
    color: #777;
}

main { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}
h1 {
    text-align: center;
    font-size: 1.8em;
}
p#service-description {
    text-align: center;
    font-size: 0.95em;
    line-height: 1.7;
    margin-top: -10px;
}
label, legend {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 2px;
}
input[type="text"], textarea, select, button, fieldset {
    width: 100%;
    font-size: 16px;
    padding: 10px;
    box-sizing: border-box; 
    margin: 0; 
    border: 1px solid #ccc; 
    border-radius: 4px;
}
fieldset {
    padding: 10px 15px;
    background-color: #fafafa;
}
textarea {
    font-family: inherit;
    min-height: 80px;
}

/* ボタン */
button { 
    font-size: 16px; 
    font-weight: bold;
    padding: 12px; 
    cursor: pointer; 
    background-color: #008fd0;
    color: white;
    border: none;
    transition: background-color 0.2s;
}
button:hover { background-color: #0072b0; }
button:disabled { background-color: #ccc; cursor: not-allowed; }

/* 結果表示・ダウンロードボタン周り */
.results-wrapper {
    margin-top: 15px;
    border-top: 2px solid #eee;
    padding-top: 20px;
}
.btns-label { font-size: 0.9em; color: #555; margin-bottom: 10px; text-align: center; font-weight: bold; }
.download-btns-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
}
.btns-row { display: flex; justify-content: center; gap: 10px; }
.download-btn {
    width: auto; flex: 1; padding: 10px; font-size: 14px; border: none; color: white; cursor: pointer; border-radius: 4px; line-height: 1.3;
}
.download-btn small { font-size: 0.8em; opacity: 0.9; display: block; }
.goal-btn { background-color: #ff9800; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.line-btn { background-color: #06c75c; } 
.pdf-btn { background-color: #d9534f; }
.img-btn { background-color: #5cb85c; }

/* AI出力結果スタイル */
.result-container > h3 { font-size: 1.5em; color: #333; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 2px solid #008fd0; }
.result-box { background: #ffffff; padding: 15px 20px; min-height: 100px; white-space: normal; border: 1px solid #eee; border-radius: 4px; margin-bottom: 20px; line-height: 1.6; }
.result-box h2 { font-size: 1.4em; margin-top: 0.5em; margin-bottom: 0.8em; padding-bottom: 5px; border-bottom: 2px solid #ccc; }
.result-box h3 { font-size: 1.2em; margin-top: 1.5em; margin-bottom: 1em; padding: 8px 12px; background-color: #eef4fa; border-left: 5px solid #008fd0; border-radius: 4px; border-bottom: none; }
.result-box h3 strong { color: #0056b3; }
.result-box h4 { font-size: 1.1em; margin-top: 1.2em; margin-bottom: 0.5em; font-weight: bold; color: #444; }
.result-box ul { padding-left: 25px; margin-top: 0.5em; margin-bottom: 1.5em; list-style-type: disc; }
.result-box li { margin-bottom: 0.8em; padding-left: 5px; line-height: 1.5; }
.result-box strong { color: #0072b0; }


/* --- ★Myゴールシート用テンプレートのスタイル（修正済）★ --- */

.goal-sheet {
    /* 画面外（左）に配置してユーザーからは見えないようにする */
    position: fixed;
    top: 0;
    left: -9999px; 
    z-index: -9999;
    
    /* 指定サイズで固定 */
    width: 800px; 
    height: 800px;
    background-color: #fcfcfc; /* 紙っぽい白 */
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "MS PMincho", serif; /* 明朝体 */
    box-sizing: border-box;
    
    /* 外枠（青い額縁） */
    border: 30px solid #3e62ad; 
    
    /* 中身を中央揃えにする */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* 変形リセット */
    transform: none;
}

.goal-sheet-inner {
    width: 100%;
    height: 100%;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- リボン（MY GOAL!） --- */
.gs-ribbon-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.gs-ribbon {
    position: relative;
    background: #3e62ad;
    color: #fff;
    padding: 10px 60px;
    font-size: 36px;
    font-weight: bold;
    font-family: "Impact", sans-serif;
    letter-spacing: 2px;
    text-align: center;
    border-radius: 0 0 50% 50% / 0 0 15px 15px;
}

.gs-ribbon::before, .gs-ribbon::after {
    content: '';
    position: absolute;
    top: 0;
    width: 40px;
    height: 50px;
    background: #2a4680;
    z-index: -1;
    border-radius: 5px;
}
.gs-ribbon::before { left: -15px; transform: skewY(20deg); }
.gs-ribbon::after { right: -15px; transform: skewY(-20deg); }

/* --- 日付エリア（中央揃え） --- */
.gs-date-area {
    width: 100%;
    margin-top: 140px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    font-size: 24px;
    color: #555;
}

.gs-date-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    border-bottom: 2px solid #ccc;
    padding-bottom: 5px;
    min-width: 300px;
    justify-content: center;
}

.gs-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    min-width: 60px;
    text-align: center;
    font-family: sans-serif;
}

/* --- メイン目標エリア（★位置修正★） --- */
.gs-main-goal-area {
    flex-grow: 1; 
    width: 100%;
    padding: 0 40px;
    
    /* ★ここが修正点：下のスペースを確保して、重心を上に上げる */
    padding-bottom: 120px; 

    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.gs-main-goal {
    font-size: 56px;
    font-weight: bold;
    color: #0044cc;
    line-height: 1.3;
    word-break: break-word;
    width: 100%;
}
.gs-main-goal small {
    display: block;
    margin-top: 20px;
    font-size: 24px;
    color: #888;
    font-weight: normal;
}

/* --- NAMEエリア --- */
.gs-name-container {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: flex-end;
}

.gs-name-band {
    display: flex;
    width: 100%;
    height: 80px;
}

.gs-name-label {
    background-color: #3e62ad;
    color: white;
    font-family: "Impact", sans-serif;
    font-size: 40px;
    padding: 0 35px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
}

.gs-name-input-box {
    flex-grow: 1;
    background-color: #fdfdfd;
    border-top: 4px solid #3e62ad;
    height: 100%;
}
/* --- 以下、style.css の一番最後に追加してください --- */

/* ★会話形式UI (chat.html) 専用スタイル */
.chat-container {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ステップごとの表示制御 */
.chat-step {
    display: none; /* 基本は非表示 */
    animation: fadeIn 0.5s ease;
}
.chat-step.active {
    display: block; /* アクティブな時だけ表示 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 質問文 */
.chat-question {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.4;
}
.chat-sub {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    display: block;
}

/* 選択肢ボタン（ラジオボタンの代わり） */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-option-label {
    display: block;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    text-align: center;
}
.chat-option-label:hover {
    background-color: #f0f8ff;
    border-color: #008fd0;
    color: #008fd0;
}
/* ラジオボタン本体は隠す */
.chat-options input[type="radio"] {
    display: none;
}
/* 選択された状態 */
.chat-options input[type="radio"]:checked + .chat-option-label {
    background-color: #008fd0;
    border-color: #008fd0;
    color: white;
}

/* ナビゲーションボタン */
.chat-nav {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
}
.btn-next, .btn-back {
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-next {
    background-color: #008fd0;
    color: white;
    margin-left: auto; /* 右寄せ */
}
.btn-back {
    background-color: #eee;
    color: #555;
}
.btn-next:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* プログレスバー */
.progress-container {
    width: 100%;
    background-color: #eee;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 30px;
}
.progress-bar {
    height: 100%;
    background-color: #008fd0;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
}