/*
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

入場登録ページ、アカウント設定ページのフォーム用CSS

frontend-user-adminプラグインで作成されたフォーム用

form.cssの必要な箇所を上書きしているので、form.cssも読み込むこと。
form.cssは極力編集しない方向になりました。

■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
*/

.page-form .frontend-user-admin-login {
    --form-element-my: 8px; /* 12px */
    --form-font-size: 15px; /* 16px */
    --form-item-my: 40px; /* 48px */
}

.form-container {
    border: 4px solid var(--blue-border);
    border-radius: var(--border-radius-sm);
    padding: 56px;
}

.page-form .frontend-user-admin-login {
    font-size: 14px;
}

@media (width <= 768px){

    .form-container {
        border: 2px solid var(--blue-border);
        padding: 24px;
    }

}

/*
*****************************************************************************************

フォームの要素

*****************************************************************************************
*/

.page-form .frontend-user-admin-login {

    /*
    ***************************** checkbox *****************************
    */

    input[type="checkbox"] {
        display: inline; /* noneだとフォーカスが当たらない */
        /* visibility: hidden; だとフォーカスが当たらない */
        opacity: 0;
        position: absolute;
        z-index: -1;
        pointer-events: none;
    } 

    .label-checkbox,
    table.form-table .label-checkbox {
        --checkbox-size: 22px;
        min-height: var(--checkbox-size);
        padding-left: calc(var(--checkbox-size) + 8px);
        margin-right: 22px;
        margin-bottom: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        line-height: 1;
        padding-bottom: .2em;
        position: relative;
    }

    :where(.checkboxes) .label-checkbox:only-child {
        margin-right: 0;
        margin-bottom: 0;
    }

    .checkboxes:has( > .label-checkbox:only-child) {
        margin-block: var(--form-element-my);
    }

    .label-checkbox .checkbox-btn,
    table.form-table .label-checkbox .checkbox-btn {
        width: var(--checkbox-size);
        height: var(--checkbox-size);
        top: 0;
        border: 2px solid var(--gray-input);
        border-radius: var(--border-radius-xs);
    }

    .label-checkbox:has(.checkbox:not(:disabled):not([tabindex="-1"])) {
        cursor: pointer;
    }

    /* checked */

    .label-checkbox input[type="checkbox"]:checked + .checkbox-btn::after, 
    table.form-table .label-checkbox input[type="checkbox"]:checked + .checkbox-btn::after, 
    .label-checkbox .checkbox:checked + .checkbox-btn::after,
    table.form-table .label-checkbox .checkbox:checked + .checkbox-btn::after  {
        width: calc(var(--checkbox-size) * .6);
        height: calc(var(--checkbox-size) * .4);
        top: 13%;
        left: 14%;
        border-color: var(--blue-highlight)
    }

    /* focus */

    .label-checkbox .checkbox:focus-visible + .checkbox-btn {
        border-color: var(--blue-highlight)
    }

    /* disabled */

    .label-checkbox:has(.checkbox:disabled) {
        opacity: .5;
    }

    .label-checkbox .checkbox:disabled + .checkbox-btn::after {
        border-color: var(--gray);
    }

    /* readonly */

    .label-checkbox .checkbox[tabindex="-1"] + .checkbox-btn::after {
        border-color: var(--gray);
    }

    /*
    ***************************** radio *****************************
    */

    input[type="radio"] {
        display: inline; /* noneだとフォーカスが当たらない */
        /* visibility: hidden; だとフォーカスが当たらない */
        opacity: 0;
        position: absolute;
        z-index: -1;
        pointer-events: none;
    }

    .label-radio,
    table.form-table .label-radio {
        --radio-size: 22px;
        min-height: var(--radio-size);
        padding-left: calc(var(--radio-size) + 7px);
        margin-right: 22px;
        margin-bottom: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        line-height: 1;
        padding-bottom: .2em;
        position: relative;
    }

    :where(.radios) .label-radio:only-child {
        margin-right: 0;
        margin-bottom: 0;
    }

    .label-radio .radio-btn,
    table.form-table .label-radio .radio-btn {
        width: var(--radio-size);
        height: var(--radio-size);
        top: 0;
        border: 2px solid var(--gray-input);
    }

    .label-radio:has(.radio:not(:disabled):not([tabindex="-1"])) {
        cursor: pointer;
    }

    /* checked */

    .label-radio .radio:checked + .radio-btn::after,
    table.form-table .label-radio .radio:checked + .radio-btn::after {
        width: calc(var(--radio-size) - 10px);
        height: calc(var(--radio-size) - 10px);
        background-color: var(--blue-highlight);
    }

    /* focus */

    .label-radio .radio:focus-visible + .radio-btn {
        border-color: var(--blue-highlight)
    }

    /* disabled */

    .label-radio:has(.radio:disabled) {
        opacity: .5;
    }

    .label-radio .radio:disabled + .radio-btn::after {
        background-color: var(--gray);
    }

    /* readonly */

    .label-radio .radio[tabindex="-1"] + .radio-btn::after {
        background-color: var(--gray);
    }

    /*
    ***************************** inputtext *****************************
    */

    input[type="text"], 
    input[type="password"] {
        font-size: var(--form-font-size);
        border: 1px solid var(--gray-input);
        padding: 0.4em 0.8em 0.425em;
    }

    /*
    ***************************** select *****************************
    */

    select {
        font-size: var(--form-font-size);;
    }

    /*
    ***************************** label *****************************
    */

    /* .form-labelと同等 */
    table.form-table th label {
        all: unset;
        font-weight: bold;
    }

    /*
    ***************************** note *****************************
    */

    /* .form-noteと同等 */
    .frontend-user-admin-user-attribute-comment {
        color: var(--gray);
    }

    /*
    ***************************** error *****************************
    */

    div.error {
        margin-bottom: 32px;
        padding: 12px 20px;
    }

    /*
    ***************************** message *****************************
    */

    div.message {
        margin-bottom: 32px;
        padding: 12px 20px;
    }

    /*
    ***************************** btn *****************************
    */

    .btn-back.btn-back {
        background: var(--blue);
    }

    .submit.login {
        border-radius: 10em;
        background: var(--red);
        text-align: center;
        margin: 8px auto 16px;
    }

    #loginform + .login-form-sub-link li:nth-of-type(1) a, 
    #loginform + .ta-r li:nth-of-type(1) a {
        border-radius: 10em;
        background: var(--blue);
        text-align: center;
        margin: 0 auto 24px;
    }

    /* ログイン画面の「ログイン」ボタンと「入場登録がお済みでない方はこちら」ボタンのサイズを揃える */
    #loginform .submit.login,
    #loginform + .ta-r li:nth-of-type(1) a {
        min-width: 280px;
        width: fit-content;
    }

}

/*
*****************************************************************************************

フォームの基本レイアウト

*****************************************************************************************
*/

.page-form .frontend-user-admin-login {

    /* .form-listと同等 */
    table.form-table {
        all: unset;
        display: block;
    }

    :where(table.form-table) + table.form-table  {
        margin-top: var(--form-item-my);
    }

    table.form-table thead,
    table.form-table tbody,
    table.form-table tfoot {
        all: unset;
        display: block;
    }

    /* .form-itemと同等 */
    table.form-table tr {
        all: unset;
        display: block;
        margin-top: var(--form-item-my);
    }

    table.form-table tr:first-child {
        margin-top: 0;
    }

    /* .form-item-headerと同等 */
    table.form-table th {
        all: unset;
        display: block;
        margin-bottom: var(--form-element-my);
    }

    /* チェックボックスがあるときは、気持ち余白を大きくしたい */
    table.form-table th:has( + td .label-checkbox) {
        margin-bottom: calc(var(--form-element-my) + 8px);
    }


    /* .form-item-bodyと同等 */
    table.form-table td {
        all: unset;
        display: block;
    }

    /* ラジオボタンのmargin-bottom分、余分に余白が空くので詰める */
    table.form-table td:has( > .label-radio:last-child),
    table.form-table td:has( > .label-radio + br + .frontend-user-admin-user-attribute-comment:last-child:empty) {
        --radio-size: 22px;
        margin-bottom: calc((var(--radio-size) * .5) * -1);
    }

    /* チェックボックスのmargin-bottom分、余分に余白が空くので詰める */
    table.form-table td:has( > .label-checkbox:last-child),
    table.form-table td:has( > .label-checkbox + br + .frontend-user-admin-user-attribute-comment:last-child:empty) {
        --checkbox-size: 22px;
        margin-bottom: calc((var(--checkbox-size) * .5) * -1);
    }

    /* 送信ボタンなど */
    .form-btn-blok {
        margin: 64px 0 16px;
        display: flex;
        justify-content: center;
        gap: 8px;
    }

    @media (max-width:768px){
        .form-btn-blok{
            margin-top: 28px;
        }
    }

}

/*
*****************************************************************************************

#フォームの細かいところのレイアウト

以下のような構造になっているので、input[type="text"]自体にmarginをつける。

```
<input type="text"><br>
テキストテキストテキスト
```

```
テキストテキストテキスト<br>
<input type="text">
```

*****************************************************************************************
*/

.page-form .frontend-user-admin-login {

    /*
    ***************************** inputtext *****************************
    */

    /* textboxが上下に並んだときや、textboxの上下にテキストの並んだときの余白 */
    input[type="text"]:not(:only-child), 
    input[type="password"]:not(:only-child) {
        margin-block: var(--form-element-my);
    }

    /* 先頭だったら上の余白を削除 */
    input[type="text"]:first-child, 
    input[type="password"]:first-child {
        margin-top: 0;
    }

    /* 最後だったら下の余白を削除 */
    input[type="text"]:last-child, 
    input[type="password"]:last-child {
        margin-bottom: 0;
    }

    /* 最後が空の要素だったら下の余白を削除 */
    input[type="text"]:has( + .frontend-user-admin-user-attribute-comment:last-child:empty), 
    input[type="password"]:has( + .frontend-user-admin-user-attribute-comment:last-child:empty) {
        margin-bottom: 0;
    }

    /* 最後が空の要素だったら下の余白を削除 */
    input[type="text"]:has( + br + .frontend-user-admin-user-attribute-comment:last-child:empty), 
    input[type="password"]:has( + br+ .frontend-user-admin-user-attribute-comment:last-child:empty) {
        margin-bottom: 0;
    }

    table.form-table td .user_email:nth-of-type(1) {
        margin-bottom: var(--form-element-my);
    }

    /*
    ***************************** select *****************************
    */

    /* textboxが上下に並んだときや、textboxの上下にテキストの並んだときの余白 */
    select:not(:only-child) {
        margin-block: var(--form-element-my);
    }

    /* 先頭だったら上の余白を削除 */
    select:first-child {
        margin-top: 0;
    }

    /* 最後だったら下の余白を削除 */
    select:last-child {
        margin-bottom: 0;
    }

    /* 最後が空の要素だったら下の余白を削除 */
    select:has( + .frontend-user-admin-user-attribute-comment:last-child:empty) {
        margin-bottom: 0;
    }

    /* 最後が空の要素だったら下の余白を削除 */
    select:has( + br+ .frontend-user-admin-user-attribute-comment:last-child:empty) {
        margin-bottom: 0;
    }

    /*
    ***************************** radio *****************************
    */

    table.form-table td:has() {

    }

    /*
    ***************************** privacy *****************************
    */

    .form-privacy {
        text-align: left;
        margin: 16px 0;
    }

}




