/**
 * 免密碼登入 / 註冊卡片
 *
 * 樣板：themes/blocksy-child/woocommerce/myaccount/form-login.php
 * 色票沿用 gacha-product.css 的限定轉蛋橘（#f5a623）。
 */

.wtoy-auth {
    --wtoy-auth-primary: #f5a623;
    --wtoy-auth-primary-dark: #e09615;
    --wtoy-auth-primary-soft: #fff8ec;
    --wtoy-auth-border: #e5e5e5;
    --wtoy-auth-text: #2b2b2b;
    --wtoy-auth-muted: #7a7a7a;
    --wtoy-auth-danger: #d1453b;
    --wtoy-auth-success: #2e7d4f;

    display: flex;
    justify-content: center;
    padding: 24px 0 48px;
    color: var(--wtoy-auth-text);
}

.wtoy-auth__card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

/* ---------------------------------------------------------------- 標題 */

.wtoy-auth__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.wtoy-auth__mark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(var(--wtoy-auth-primary) 0 25%, #fff 25% 50%, var(--wtoy-auth-primary) 50% 100%);
    border: 2px solid var(--wtoy-auth-primary);
    flex: 0 0 auto;
}

.wtoy-auth__title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

/* ------------------------------------------------------- 登入 / 註冊分頁 */

.wtoy-auth__modes {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.wtoy-auth__mode {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--wtoy-auth-border);
    color: var(--wtoy-auth-muted);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.wtoy-auth__mode.is-active {
    color: var(--wtoy-auth-primary-dark);
    border-bottom-color: var(--wtoy-auth-primary);
}

/* ---------------------------------------------------------------- 提示 */

.wtoy-auth__alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.wtoy-auth__alert.is-error {
    background: #fdecea;
    color: var(--wtoy-auth-danger);
}

.wtoy-auth__alert.is-success {
    background: #eaf6ef;
    color: var(--wtoy-auth-success);
}

/* ---------------------------------------------------------------- 欄位 */

.wtoy-auth__field {
    margin-bottom: 22px;
}

.wtoy-auth__label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}

.wtoy-auth__optional {
    margin-left: 4px;
    font-weight: 400;
    font-size: 13px;
    color: var(--wtoy-auth-muted);
}

.wtoy-auth__hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--wtoy-auth-muted);
}

.wtoy-auth__hint--secure::before {
    content: '\1F512';
    margin-right: 6px;
}

.wtoy-auth__input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 10px;
    background: #fff;
    font-size: 16px; /* 低於 16px 時 iOS Safari 會自動放大頁面 */
    color: var(--wtoy-auth-text);
    box-sizing: border-box;
}

.wtoy-auth__input:focus {
    outline: none;
    border-color: var(--wtoy-auth-primary);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, .18);
}

select.wtoy-auth__input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7a7a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
}

.wtoy-auth__input-group {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.wtoy-auth__dial {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 10px;
    background: #fafafa;
    font-size: 16px;
    color: var(--wtoy-auth-muted);
    white-space: nowrap;
}

/* -------------------------------------------------------- 驗證方式切換 */

.wtoy-auth__segment {
    display: flex;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 10px;
    overflow: hidden;
}

.wtoy-auth__segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    background: #fff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--wtoy-auth-muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.wtoy-auth__segment-btn + .wtoy-auth__segment-btn {
    border-left: 1px solid var(--wtoy-auth-border);
}

.wtoy-auth__segment-btn.is-active {
    background: var(--wtoy-auth-primary-soft);
    color: var(--wtoy-auth-primary-dark);
    box-shadow: inset 0 0 0 2px var(--wtoy-auth-primary);
}

.wtoy-auth__segment-icon {
    font-size: 17px;
    line-height: 1;
}

/* ---------------------------------------------------------- 驗證碼輸入 */

.wtoy-auth__code-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.wtoy-auth__code {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.wtoy-auth__code-box {
    flex: 1 1 0;
    min-width: 0;
    max-width: 56px;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 10px;
    background: #fff;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--wtoy-auth-text);
    box-sizing: border-box;
}

.wtoy-auth__code-box:focus {
    outline: none;
    border-color: var(--wtoy-auth-primary);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, .18);
}

.wtoy-auth__send {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.wtoy-auth__send-btn {
    padding: 14px 18px;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 10px;
    background: #fff;
    color: var(--wtoy-auth-primary-dark);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.wtoy-auth__send-btn:hover:not(:disabled) {
    border-color: var(--wtoy-auth-primary);
    background: var(--wtoy-auth-primary-soft);
}

.wtoy-auth__send-btn:disabled {
    color: var(--wtoy-auth-muted);
    cursor: not-allowed;
    opacity: .7;
}

.wtoy-auth__countdown {
    font-size: 13px;
    color: var(--wtoy-auth-muted);
    min-height: 18px;
}

/* ---------------------------------------------------------------- 送出 */

.wtoy-auth__submit {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    background: var(--wtoy-auth-primary);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.wtoy-auth__submit:hover:not(:disabled) {
    background: var(--wtoy-auth-primary-dark);
}

.wtoy-auth__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ------------------------------------------------------ 保持登入說明 */

.wtoy-auth__persist {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--wtoy-auth-border);
    border-radius: 10px;
    background: #fff;
}

.wtoy-auth__persist-icon {
    flex: 0 0 auto;
    display: flex;
    margin-top: 2px;
    color: var(--wtoy-auth-success);
}

.wtoy-auth__persist strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--wtoy-auth-text);
}

.wtoy-auth__persist p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--wtoy-auth-muted);
}

/* ------------------------------------------------------ 下次登入流程 */

.wtoy-auth__flow {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--wtoy-auth-border);
}

.wtoy-auth__flow-title {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wtoy-auth-text);
}

.wtoy-auth__flow-steps {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wtoy-auth__step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
}

.wtoy-auth__step-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f5f5f5;
    color: var(--wtoy-auth-text);
}

.wtoy-auth__step-icon--ok {
    background: #eaf6ef;
    color: var(--wtoy-auth-success);
}

.wtoy-auth__step-text {
    min-width: 0;
}

.wtoy-auth__step-text strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--wtoy-auth-text);
}

.wtoy-auth__step-text span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--wtoy-auth-muted);
}

.wtoy-auth__flow-arrow {
    flex: 0 0 auto;
    display: flex;
    color: #c9c9c9;
}

/* ---------------------------------------------------------------- 頁尾 */

.wtoy-auth__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 24px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--wtoy-auth-border);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    color: var(--wtoy-auth-muted);
}

.wtoy-auth__footer svg {
    flex: 0 0 auto;
}

/* Blocksy 帳號 modal 被停用後的替代內容 */
.wtoy-legacy-modal-notice {
    padding: 24px 8px;
    text-align: center;
}

.wtoy-legacy-modal-notice p {
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------- RWD */

@media (max-width: 560px) {
    .wtoy-auth {
        padding: 12px 0 32px;
    }

    .wtoy-auth__card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .wtoy-auth__title {
        font-size: 24px;
    }

    .wtoy-auth__code-row {
        gap: 12px;
    }

    .wtoy-auth__code {
        gap: 6px;
        width: 100%;
    }

    .wtoy-auth__code-box {
        max-width: none;
        font-size: 20px;
    }

    .wtoy-auth__send {
        width: 100%;
        align-items: stretch;
    }

    .wtoy-auth__send-btn {
        width: 100%;
    }

    .wtoy-auth__countdown {
        text-align: center;
    }

    .wtoy-auth__segment-btn {
        font-size: 14px;
        padding: 12px 4px;
    }

    /* 兩個步驟並排會擠到換行，改為直向並把箭頭轉 90 度 */
    .wtoy-auth__flow-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .wtoy-auth__flow-arrow {
        align-self: center;
        transform: rotate(90deg);
    }

    .wtoy-auth__footer {
        align-items: flex-start;
        text-align: left;
    }

    .wtoy-auth__footer svg {
        margin-top: 3px;
    }
}
