.main-content {
    text-align: center;
    max-width: 420px;
    margin: 0px auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* ヘッダー親要素を中央揃え */
.header-container {
    display: flex;
    justify-content: center;
    /* 水平方向の中央揃え */
    align-items: center;
    /* 垂直方向の中央揃え */
    text-align: center;
    /* テキストも中央揃え */
    width: 100%;
}

/* ヘッダー子要素のスタイル */
.header-image {
    display: flex;
    flex-direction: column;
    /* 縦方向に配置 */
    justify-content: center;
    /* 垂直方向の中央揃え */
    align-items: center;
    /* 水平方向の中央揃え */
    width: 100%;
    /* 親要素の幅を100%に設定 */
    height: 210px;
    /* 親要素の高さ */
    margin: 0 auto;
    /* 親要素自体を中央揃え */
    position: relative;
    /* 必要に応じて調整 */
}

/* 画像のスタイル */
.header-image img {
    width: 100%;
    height: auto;
    /* 縦横比を保つ */
    max-width: 100%;
    /* 親要素を超えないよう制限 */
    display: block;
    /* 画像の余白や挙動を安定させる */
    margin: 0 auto;
    /* 画像を中央揃え */
    margin-top: 40px;
}

h3 {
    display: inline-block;
    text-align: left;
    border-left: 4px solid #560754;
    padding-left: 10px;
    margin-bottom: 30px;
    color: #560754;
    font-size: 15px;
    margin-left: auto;
    margin-right: auto;
}

.main-content h3,
.main-content>h3 {
    display: inline-block;
}

.main-content input[type="text"],
.main-content input[type="email"],
.main-content input[type="password"],
.main-content select {
    display: block;
    margin: 10px auto;
    width: 90%;
    max-width: 240px;
    box-sizing: border-box;
    text-align: center;
}

/* === form内の中央揃え === */
form {
    max-width: 350px;
    margin: 0 auto 20px auto;
    text-align: center;
}

/* ボタンも中央 */
form>button,
form>.line-button,
form>.google-button,
form>.register-button {
    display: block;
    margin: 10px auto;
    width: 90%;
    max-width: 260px;
    box-sizing: border-box;
    text-align: center;
}

form>button {
    max-width: 180px;

}

/* チェックボックスだけ横並びを維持 */
form>input[type="checkbox"] {
    display: inline-block;
    margin: 0 5px 0 0;
    vertical-align: middle;
}

/* ボタン類 */
.line-button,
.google-button,
.register-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 250px;
    margin: 15px auto;
    font-size: 17px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 10px;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* === 個別ボタンカラーだけ上書き === */
.line-button {
    background-color: #06ac3d;
    color: white;
    border: 1px solid #014518;
}

.line-button:hover {
    background-color: #6bf98351;
    color: black;
}

.google-button {
    background-color: #fff;
    color: #444;
    border: 2px solid #dadce0;
    box-shadow: 0 1px 1px rgba(60, 64, 67, 0.08);
}

.google-button:hover {
    background-color: #f2f2f2;
    color: #111;
    border-color: #aaa;
}

.register-button {
    background-color: rgb(236, 122, 22);
    color: white;
    border: 1px solid #bc5b07;
}

.register-button:hover {
    background-color: rgba(236, 122, 22, 0.482);
    color: white;
    border-color: #aaa;
}

/* ボタン内画像 */
.line-button img,
.google-button img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: inline-block;
}

/* 仕切り線 */
.divider {
    border: 0;
    border-top: 2px solid #ccc;
    margin: 40px 0;
    width: 100%;
}

/* 小テキスト・リンク類 */
.small-text {
    font-size: 0.9em;
    color: #555;
}

.no-underline {
    text-decoration: none;
    color: inherit;
}

/* チェックボックス横テキスト */
form>span.small-text {
    display: inline-block;
    vertical-align: middle;
}

#forgotUsername button,
#forgotPassword button,
#resetPasswordForm button {
    display: block;
    margin: 35px auto 10px auto;
    width: 90%;
    max-width: 220px;
    box-sizing: border-box;
    text-align: center;
}

.backbutton {
    display: block;
    margin: 50px auto 40px auto;
    width: 110px !important;
    max-width: 110px !important;
    box-sizing: border-box;
    text-align: center;
}

/* 2FA・認証アプリフォームのinput, button中央寄せ */
#twoFactorAuthForm input[type="text"],
#twoFactorAuthForm button,
#appTwoFactorAuthForm input[type="text"],
#appTwoFactorAuthForm button {
    display: block;
    margin: 16px auto;
    width: 90%;
    max-width: 230px;
    box-sizing: border-box;
    text-align: center;
}

input,
select {
    border: 2px solid #333;
    background-color: transparent;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 25px;
    outline: none;
    color: #333;
}

#loginForm {
    margin-top: 40px;
}

#username {
    margin-bottom: 18px;
}

#password,
#newPassword,
#confirmPassword {
    display: block;
    margin-bottom: 10px;
}

#forgotUsername,
#forgotPassword,
#resetPasswordForm,
#twoFactorAuthForm,
#appTwoFactorAuthForm {
    display: none;
}

#forgotUsernameLink {
    display: block;
    font-size: 0.8em;
    cursor: pointer;
}

#forgotPasswordLink {
    font-size: 0.8em;
    cursor: pointer;
}

#resetEmail,
#resetUsername {
    display: block;
    margin-bottom: 10px;
}

.label-margin2 {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
}

#twoFactorCode {
    display: block;
    margin-top: 10px;
}

#messageBox,
#appMessageBox {
    color: red;
    margin-top: 10px;
}

#submitButton,
#verifyButton,
#confirmation,
#requestButton,
#resetPasswordButton,
#verifyAppTwoFactorCodeButton {
    display: block;
    border: none;
    background-color: #4b4a4a;
    color: white;
    padding: 10px 20px;
    margin-top: 35px;
    margin-bottom: 10px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
}

#registrationButton {
    display: block;
    margin-top: 35px;
    margin-bottom: 35px;
}

#verifyButton {
    margin-top: 20px !important;
}

#verifyAppTwoFactorCodeButton {
    margin-top: 30px !important;
}

#confirmation {
    margin-top: 30px !important;
}

#resendButton {
    margin-top: 30px !important;
    max-width: 180px !important;
    font-size: 14px;
}

#submitButton:hover,
#verifybutton:hover,
#verifyButton:hover,
#confirmation:hover,
#requestButton:hover,
#resetPasswordButton:hover,
#verifyAppTwoFactorCodeButton:hover {
    background-color: #0b0b0b9a;
}

/* トーストの基本スタイル（PC向け） */
#toast {
    position: fixed;
    pointer-events: none;
    /* 背後の要素のクリックを許可 */
    top: 20%;
    /* 画面の上から20%の位置 */
    left: 0;
    /* 左端から開始 */
    right: 0;
    /* 右端まで */
    margin: 0 auto;
    /* 左右中央揃え */
    width: calc(100% - 40px);
    /* 画面幅から左右のマージンを差し引く */
    max-width: 1200px;
    /* 必要に応じて最大幅を設定 */
    background-color: #333;
    /* 背景色 */
    color: #fff;
    /* 文字色 */
    padding: 35px 20px;
    /* 内側の余白 */
    border-radius: 4px;
    /* 角を丸くする */
    opacity: 0;
    /* 初期状態では非表示 */
    transition: opacity 0.4s ease-in-out;
    /* 表示時のトランジション */
    z-index: 9999;
    /* 最前面に配置 */
    font-size: 16px;
    /* 文字サイズ */
    box-sizing: border-box;
    /* パディングを含めてサイズ計算 */
    text-align: center;
    /* メッセージを中央揃え */
}

/* クローズボタンのスタイル */
#toastCloseButton {
    position: absolute;
    /* トースト枠の右上に配置 */
    top: 10px;
    /* 上からの距離 */
    right: 10px;
    /* 右からの距離 */
    background: none;
    /* 背景を消す */
    border: none;
    /* ボーダーを消す */
    color: #fff;
    /* 文字色 */
    font-size: 24px;
    /* ボタンの文字サイズ */
    cursor: pointer;
    /* カーソルをポインターに */
    outline: none;
    /* フォーカス時のアウトラインを消す */
    line-height: 1;
    /* ボタン内のテキスト高さ調整 */
    pointer-events: auto;
    /* クリック可能にする */
}

/* クローズボタンのホバー時のスタイル */
#toastCloseButton:hover {
    color: #aaa;
    /* ホバー時の色変更 */
}

/* トーストを表示する際に付与するクラス */
#toast.show {
    pointer-events: auto;
    /* 表示時はクリック可能にする */
    opacity: 1;
    /* 表示状態 */
}

/* タイムアップモーダルのスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease-in-out;
}

/* 表示時の中央揃えと表示切り替え */
.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInScale 0.3s ease-in-out;
}

.modal-content p {
    font-size: 16px;
    margin-bottom: 20px;
}

.modal-content button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-content button:hover {
    background-color: #0056b3;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ログインボタンのメッセージ点滅アクション */
@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.blinking {
    animation: blink 0.5s infinite;
}

/* スマホ向けのスタイル */
@media screen and (max-width: 768px) {

    .main-content {
        flex: 1;
        /* コンテンツエリアが残りのスペースを占有 */
        background-color: #fff;
        padding: 10px 30px;
    }

    #toast {
        top: 20%;
        /* スマホでも画面上から20%の位置 */
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        transform: none;
    }

    #toastCloseButton {
        top: 3px;
        /* 上からの距離 */
        right: 3px;
        /* 右からの距離 */
    }

    /* ヘッダー子要素のスタイル */
    .header-image {
        height: 170px;
    }

    /* 画像のスタイル */
    .header-image img {
        width: 90%;
        margin-top: 10px;
    }

    #loginForm {
        margin-top: 8px !important;
    }
}