/* ============================================================
   独自拡張CSS
   プライムネット社デザイン(style.css)には無い、本システム独自の
   UIパーツ(検証モーダル・確認モーダル・入力エラー表示)のスタイル。
   style.css の後に読み込むこと。デザインデータ自体は変更しない。
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 30, 20, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

/* hidden属性が付いている間は、上のdisplay:flexより優先して非表示にする */
.modal-overlay[hidden] {
    display: none;
}

.modal {
    width: min(560px, 100%);
    max-height: 80vh;
    overflow-y: auto;
    padding: 28px 32px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

#confirmModal .modal {
    max-width: 620px;
}

.modal__title {
    margin: 0 0 14px;
    color: #333;
    font-size: 19px;
    font-weight: 700;
}

.modal__error-list {
    margin: 0 0 20px;
    color: #e86b6b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.modal__summary {
    margin: 0 0 20px;
    font-size: 14px;
}

.modal__summary dt {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    color: #888;
    font-weight: 700;
}

.modal__summary dt:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.modal__summary dd {
    margin: 4px 0 0;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

.modal__actions--split {
    justify-content: space-between;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.btn--primary {
    background: linear-gradient(90deg, #e86d72, #f59a22);
    color: #fff;
}

.btn--primary:hover {
    filter: brightness(1.05);
}

.btn--outline {
    padding: 12px 8px;
    border: 0;
    background: transparent;
    color: #666;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn--outline:hover {
    color: #df746b;
}

/* 入力エラー時の強調表示(必須未入力・不正値) */
.field--has-error input[type="text"],
.field--has-error input[type="number"],
.field--has-error input[type="date"],
.field--has-error input[type="email"],
.field--has-error textarea,
.field--has-error select {
    border-color: #e86b6b;
    background: #fff6f6;
}

.field--has-error .file-upload {
    border-color: #e86b6b;
}

.field--has-error .checkbox-col label,
.field--has-error .checkbox-row label,
.field--has-error .radio-col label {
    color: #e86b6b;
}

/* .input-row は display:grid (120px 1fr) のため、エラーメッセージを
   そのまま追加すると3つ目の子要素として1列目(120px)に配置されてしまう。
   2列分(行全体)を使うように指定して幅100%で表示する。 */
.input-row .required-error-message {
    grid-column: 1 / -1;
    width: 100%;
}

/* type="email" にはデザインデータ(style.css)でスタイルが定義されておらず、
   ブラウザ標準の見た目(枠線等)になってしまうため、type="text" と揃える。 */
input[type="email"] {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #555;
    font-size: 15px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

input[type="email"]:focus {
    border-color: #e89572;
    box-shadow: 0 0 0 2px rgba(232, 149, 114, 0.12);
}

input[type="email"]::placeholder {
    color: #c8c8c8;
}

input[type="email"]:disabled {
    background: #f1f1f1;
    color: #aaa;
    cursor: not-allowed;
}

/* style.cssの「.section > h4, .section-title h4 { display: flex; }」は、
   hidden属性付きのh4(作業内容に応じて見出し文言自体を切り替える箇所など)に
   対しても効いてしまい、hidden属性によるdisplay:noneを上書きしてしまう。
   hidden時は明示的にdisplay:noneへ戻す。 */
.section > h4[hidden],
.section-title h4[hidden] {
    display: none;
}

/* 停止のタイミング等、日付入力欄の直後に「をもって停止」のような文言を
   横並びで表示したい場合に使う修飾クラス。.detail-inputは通常ブロック要素
   (縦積み)のため、これを付けた場合のみ隣接文言と同じ行に並べる。 */
.detail-input--inline {
    display: inline-block;
}

.detail-input--inline[hidden] {
    display: none;
}

/* デザインデータでは日付入力欄を<time>(width:220px)で囲み、その中で
   input[type="date"]をwidth:100%にすることで固定幅にしている。
   当システムでは<time>の代わりに.detail-input(表示/disabled切替用のdiv)で
   囲んでいるため、そのままだと入力欄が横いっぱいに広がってしまう。
   .detail-input内のinput[type="date"]にも同じ固定幅を適用する。 */
.detail-input input[type="date"],
.detail-input--inline input[type="date"] {
    width: 220px;
}

/* 日付入力欄(input[type="date"])のdisabled時の見た目。
   style.css の input[type="date"] の背景指定が input:disabled と同じ詳細度で後ろにあるため、
   disabledのグレー背景が効かず、type="text"等と見た目が揃わなかった。
   他のinputの disabled(style.css の input:disabled)と同じ見た目にする。 */
input[type="date"]:disabled {
    background-color: #f1f1f1;
    color: #aaa;
    cursor: not-allowed;
}

input[type="date"]:disabled::-webkit-calendar-picker-indicator {
    cursor: not-allowed;
    opacity: 0.3;
}

/* 確認モーダルの案内文(「問題がなければ『送信する』ボタンをクリックしてください。」)と、
   その下の入力内容一覧との間隔を広めに取る。 */
#confirmModal .modal > p {
    margin: 0 0 28px;
}

/* Cloudflare Turnstile(「ロボットではないこと」の確認)ウィジェットの配置。送信ボタンの上に中央寄せで表示する。 */
.turnstile-wrap {
    display: flex;
    justify-content: center;
    margin: 32px 0 0;
}
