/*==================================================
    認証サーバー共通スタイル
    ソリマチ ブランドデザイン準拠（ライトモードのみ）
    プライマリ = 農業簿記グリーン #009a59
==================================================*/

:root {
    /* ブランドカラー */
    --color-primary: #009a59;             /* ブランド緑（ロゴ・アイコン・フォーカス・アクセント） */
    --color-primary-hover: #008a4f;
    --color-primary-strong: #00824a;      /* 塗りボタン用のやや濃い緑（白文字で AA 4.9:1 を確保） */
    --color-primary-strong-hover: #006e3c;
    --color-secondary: #bde1d6;           /* セカンダリ（補助・淡色面） */
    --color-tertiary: #87caac;            /* ターシャリ */
    --color-accent: #f7ab00;              /* アクセント（ソリマチオレンジ） */
    --on-primary: #ffffff;                /* 塗り（strong 緑）の上の前景は白 */

    /* ニュートラル（真っ黒を避け、視認性と柔らかさを両立） */
    --ink: #334155;                       /* 本文（slate-700） */
    --ink-strong: #1e293b;                /* 見出し（slate-800） */
    --ink-muted: #64748b;                 /* 補助テキスト（slate-500） */
    --line: #e2e8f0;                      /* 罫線 */
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --danger: #e11d48;

    --radius: 8px;
}

/* --- 最小リセット（旧 reset.css を内包。この3画面に必要な分のみ） --- */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font: inherit;
}

/* --- ベース --- */
html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    min-height: 100vh;
    /* ごく淡いブランド緑のグラデーション。白いカードを際立たせる。 */
    background: linear-gradient(180deg, #f1f7f4 0%, #f7fafc 60%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: "Noto Sans JP", sans-serif;
}

h1, h2, h3 {
    font-weight: 700;
    color: var(--ink-strong);
}

/* インライン SVG アイコン（currentColor 追従・1em サイズ） */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    flex: 0 0 auto;
}

/*==================================================
    入力フィールド
==================================================*/
.field {
    position: relative;
    display: block;
    width: 100%;
}

    .field .field-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: var(--ink-muted);
        pointer-events: none;
    }

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

    input::placeholder {
        color: #94a3b8;
    }

    input:focus {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(0, 154, 89, .25);
    }

    input[readonly],
    input[disabled] {
        background: #f1f5f9;
        color: #94a3b8;
        cursor: not-allowed;
    }

/* アイコン付きフィールドは、アイコンと重ならないよう左パディングを広げる。
   基底の input ルール（padding:0 12px）より後に定義して確実に上書きする。 */
.field input {
    padding-left: 44px;
}

/* バリデーションメッセージ */
.text-danger {
    display: block;
    font-size: .875rem;
    color: var(--danger);
}

/*==================================================
    ボタン（角丸長方形・3階層）
==================================================*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    font: inherit;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}

    .btn-lg {
        height: 56px;
        padding: 0 20px;
        font-size: 1rem;
    }

    .btn-block {
        width: 100%;
    }

    .btn-primary {
        background: var(--color-primary-strong);
        color: #fff;
    }

        .btn-primary:hover {
            background: var(--color-primary-strong-hover);
        }

    .btn-secondary {
        background: #fff;
        color: var(--color-primary-strong);
        border-color: var(--color-primary-strong);
    }

        .btn-secondary:hover {
            background: var(--color-secondary);
        }

    .btn-tertiary {
        background: transparent;
        color: var(--color-primary);
    }

        .btn-tertiary:hover {
            background: var(--bg-subtle);
        }

    .btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

/*==================================================
    トグルスイッチ（ログイン情報を記憶する）
==================================================*/
.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .9375rem;
    color: var(--ink-muted);
    cursor: pointer;
}

    .toggle .toggle-btn {
        margin-left: auto;
    }

.toggle-btn {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex: 0 0 auto;
}

    .toggle-btn input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .toggle-btn::before {
        content: "";
        position: absolute;
        inset: 0;
        background: #cbd5e1;
        border-radius: 9999px;
        transition: background-color .2s;
    }

    .toggle-btn::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        background: #fff;
        border-radius: 9999px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
        transition: left .2s;
    }

    .toggle-btn:has(input:checked)::before {
        background: var(--color-primary);
    }

    .toggle-btn:has(input:checked)::after {
        left: 25px;
    }

    .toggle-btn:has(input:focus-visible)::before {
        box-shadow: 0 0 0 3px rgba(0, 154, 89, .25);
    }

/*==================================================
    通知バナー（資料 p.47 準拠・4種セマンティック固定色）
==================================================*/
.brand-banner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 12px;
    text-align: left;
    /* 表示のたびに再生される登場アニメーション（連続エラー時も毎回動きが出る） */
    animation: banner-in .32s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes banner-in {
    0% {
        opacity: 0;
        transform: translateY(-14px) scale(.985);
    }

    60% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes banner-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* モーション軽減設定では移動を避け、フェードのみにする（変化は残す） */
@media (prefers-reduced-motion: reduce) {
    .brand-banner {
        animation: banner-fade .3s ease-out both;
    }
}

    .brand-banner .banner-body {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* アイコンとタイトルを同じ行で中央揃え（高さ位置を一致させる）。
       line-height:1 で行ボックスをグリフに密着させ、中心ズレをなくす。 */
    .brand-banner .banner-head {
        display: flex;
        align-items: center;
        gap: 8px;
        line-height: 1;
    }

    .brand-banner .banner-icon {
        display: inline-flex;
        flex: 0 0 auto;
        font-size: 1.125rem; /* 18px。タイトル(16px)に近づけ上下のはみ出しを抑える */
    }

        /* SVG をスパンに密着させ、ベースライン由来の余白を排除する */
        .brand-banner .banner-icon .icon {
            display: block;
        }

    .brand-banner .banner-title {
        font-weight: 700;
        font-size: 1rem;
        line-height: 1;
    }

    .brand-banner .banner-message {
        margin-top: 4px;
        font-size: .875rem;
        line-height: 1.7;
        color: var(--ink);
        white-space: pre-line;     /* メッセージ内の改行(\n)を反映 */
        word-break: auto-phrase;   /* 余った場合も文節単位で改行（対応ブラウザ） */
    }

    .brand-banner .banner-close {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 2px;
        background: none;
        border: none;
        line-height: 0;
        font-size: 20px;
        color: #94a3b8;
        cursor: pointer;
    }

        .brand-banner .banner-close:hover {
            color: #475569;
        }

    .brand-banner--info {
        background: #eff6ff;
        border-color: #bfdbfe;
        border-left-color: #2563eb;
    }

        .brand-banner--info .banner-icon,
        .brand-banner--info .banner-title {
            color: #1e3a8a;
        }

    .brand-banner--success {
        background: #ecfdf5;
        border-color: #a7f3d0;
        border-left-color: #059669;
    }

        .brand-banner--success .banner-icon,
        .brand-banner--success .banner-title {
            color: #065f46;
        }

    .brand-banner--error {
        background: #fff1f2;
        border-color: #fecdd3;
        border-left-color: #e11d48;
    }

        .brand-banner--error .banner-icon,
        .brand-banner--error .banner-title {
            color: #9f1239;
        }

    .brand-banner--warning {
        background: #fffbeb;
        border-color: #fde68a;
        border-left-color: #d97706;
    }

        .brand-banner--warning .banner-icon,
        .brand-banner--warning .banner-title {
            color: #92400e;
        }
