/* ------------------------------------------------------------------
   Visual refresh v2 — signup / verify / login dialogs (.lp-modal)
   Ported from the production-only signup-modal.css/.js; restyled to
   match the white/black/orange v2 language. No social-login provider
   is wired up yet, so those options are shown as disabled "coming
   soon" buttons — same convention already used on user-signin.html —
   rather than colored icons implying a working integration.
   ------------------------------------------------------------------ */
.portal-body-v2 .lp-modal {
    border: 1px solid var(--v2-line);
    box-shadow: 0 20px 50px rgba(20, 23, 42, 0.18);
    color: var(--v2-ink);
    font-family: "Noto Sans JP", "Zen Kaku Gothic New", sans-serif;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

.portal-body-v2 .lp-modal-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.portal-body-v2 .lp-modal h2 {
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 19px;
    font-weight: 900;
}

.portal-body-v2 .lp-modal h3 {
    font-size: 14px;
    font-weight: 700;
}

.portal-body-v2 .lp-modal a {
    color: var(--v2-accent);
}

.portal-body-v2 .lp-modal .field label {
    color: var(--v2-ink);
    font-weight: 700;
    font-size: 12.5px;
}

.portal-body-v2 .lp-modal input,
.portal-body-v2 .lp-modal select {
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-r-md);
    background: var(--v2-surface);
    color: var(--v2-ink);
    font-size: 13px;
}

.portal-body-v2 .lp-modal .consent-check span {
    font-size: 12.5px;
}

.portal-body-v2 .lp-consent-group .consent-check {
    align-items: flex-start;
    min-height: 24px;
    padding: 2px 0;
}

.portal-body-v2 .lp-consent-group .consent-check input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex: 0 0 24px;
    margin-top: 0;
}

.portal-body-v2 .lp-consent-group .consent-check a {
    display: inline-block;
    padding: 4px 0;
    line-height: 16px;
    min-height: 24px;
    vertical-align: baseline;
}

.portal-body-v2 .lp-modal input:focus,
.portal-body-v2 .lp-modal select:focus {
    border-color: var(--v2-accent);
    box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.portal-body-v2 .lp-modal .btn-primary {
    background: var(--v2-accent);
    box-shadow: none;
    border-radius: var(--v2-r-md);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-body-v2 .lp-modal .btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(224, 96, 42, 0.35);
}

.portal-body-v2 .lp-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    font-size: 11px;
    color: var(--v2-muted);
}

.portal-body-v2 .lp-divider::before,
.portal-body-v2 .lp-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--v2-line);
}

.portal-body-v2 .signup-step-label {
    grid-column: 1 / -1;
    margin: 6px 0 -4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--v2-muted);
    text-transform: uppercase;
}

.portal-body-v2 .signup-step-label .consent-required {
    color: var(--v2-accent);
    font-size: inherit;
    margin-left: 0;
}

/* Signup is wider than the other lp-modals so the common fields can lay
   out three-across instead of stacking tall (matches the reviewed design). */
.portal-body-v2 #signup-modal {
    width: min(600px, 92vw);
}

.portal-body-v2 #signup-modal .form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 希望職種は常に1列目から始めて、生まれ年・居住地と同じ段
   (経験職種・実務経験年数の次の行)に折り返す。列幅は他の項目と揃えて
   均等(1fr)のまま。 */
.portal-body-v2 #signup-modal .field-row-break {
    grid-column: 1;
}

@media (max-width: 640px) {
    .portal-body-v2 #signup-modal .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 新規登録・ログインなどのダイアログでは、.full（ボタンの行・エラー・状態の表示）と「パスワードを忘れた方」を横幅いっぱいに。
   1列分の幅に押し込まれると「未入力または不正な項目があります」などが途中で折り返してしまうため */
.lp-modal .form-grid > .full,
.lp-modal .form-grid > .lp-forgot-wrap {
    grid-column: 1 / -1;
}

.portal-body-v2 .auth-options {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-body-v2 .auth-card {
    position: relative;
    flex: 1 1 100px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    border: 1.5px solid var(--v2-line);
    border-radius: var(--v2-r-md);
    background: var(--v2-surface);
    font-size: 12px;
    font-weight: 700;
    color: var(--v2-ink);
    text-align: center;
    overflow: hidden;
}

.portal-body-v2 .auth-card span {
    min-width: 0;
    overflow-wrap: break-word;
}

/* Placeholders until signup-modal.js loads providers; hidden so "準備中" never flashes. */
.portal-body-v2 .auth-card-disabled[data-social-provider]:not([data-social-linked="true"]) {
    display: none;
}

/* Linked provider (pending signup): visible, disabled look — not Google/Apple branded buttons. */
.portal-body-v2 .auth-card-disabled[data-social-linked="true"] {
    color: var(--v2-muted);
    background: var(--v2-panel);
    border-color: var(--v2-line);
    cursor: not-allowed;
}

.portal-body-v2 .auth-card-disabled[data-social-linked="true"].auth-card-google,
.portal-body-v2 .auth-card-disabled[data-social-linked="true"].auth-card-apple {
    background: var(--v2-panel);
    border: 1.5px solid var(--v2-line);
    color: var(--v2-muted);
    cursor: not-allowed;
}

.portal-body-v2 .auth-card-disabled[data-social-linked="true"].auth-card-google:hover,
.portal-body-v2 .auth-card-disabled[data-social-linked="true"].auth-card-apple:hover {
    background: var(--v2-panel);
}

/* External auth isn't wired to a real provider yet, so these read the
   same as the disabled "準備中" buttons on the login modal / user-signin
   page — not clickable, no hover/selection affordance. */
.portal-body-v2 .auth-card-disabled {
    color: var(--v2-muted);
    background: var(--v2-panel);
    cursor: not-allowed;
}

/* Apple でサインイン（サーバーで設定されているときだけ、signup-modal.js が「準備中」と差し替える）。
   Apple のガイドラインに合わせて、黒地に白の公式ロゴ（左寄せ。ロゴの高さ＝ボタンの高さ）と白の文字。文字は折り返さない。 */
.portal-body-v2 .auth-card-apple {
    gap: 0;
    min-height: 44px;
    padding: 0 14px 0 0;
    background: #000000;
    border-color: #000000;
    color: #ffffff;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.portal-body-v2 .auth-card-apple .auth-apple-logo {
    flex: none;
    display: block;
    width: auto;
    height: 44px;
}

.portal-body-v2 .auth-card-apple span {
    overflow-wrap: normal;
}

/* Google でログイン（サーバーで設定されているときだけ、signup-modal.js が「準備中」と差し替える）。
   Google のブランドガイドラインの明るい形: 白地・灰色の枠線（#747775）・濃い文字（#1F1F1F）。
   左に Google の配布物の文字なしのボタン（40×40・G のロゴ）を置き、その枠線（角の丸みも）を外側 4px 隠してボタンの枠線と二重にしない（G は内側 10〜30px）。 */
.portal-body-v2 .auth-card-google {
    gap: 2px;
    min-height: 44px;
    padding: 0 16px 0 2px;
    border: 1px solid #747775;
    background: #ffffff;
    color: #1f1f1f;
    cursor: pointer;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.portal-body-v2 .auth-card-google:hover {
    background: #f8f8f8;
}

.portal-body-v2 .auth-card-google:focus-visible {
    outline: 2px solid var(--v2-accent);
    outline-offset: 2px;
}

.portal-body-v2 .auth-card-google .auth-google-logo {
    flex: none;
    display: block;
    width: 40px;
    height: 40px;
    clip-path: inset(4px);
}

.portal-body-v2 .auth-card-google span {
    overflow-wrap: normal;
}

/* 文字を折り返さない Apple のボタンは、縮めて文字が切れないように中身の幅より狭くしない。
   Apple のボタンがあって横に並べきれないとき（スマホなど）は、外部認証のボタンを1つずつ横幅いっぱいに並べる */
.portal-body-v2 .auth-card-apple,
.portal-body-v2 .auth-card-google {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .portal-body-v2 .auth-options:has(.auth-card-apple, .auth-card-google) .auth-card {
        flex-basis: 100%;
    }
}

.portal-body-v2 .auth-card-apple:hover {
    background: #2b2b2b;
}

.portal-body-v2 .auth-card-apple:focus-visible {
    outline: 2px solid var(--v2-accent);
    outline-offset: 2px;
}

/* 新規登録: 共通項目がすべて入り、同意にもチェックしたら、Google・Apple のボタンに枠を付けて目立たせる（2026-10-16。signup-modal.js の is-ready）。
   ボタンそのもの（各社のガイドラインの見た目）は変えず、外側にアクセント色の枠と淡い光を足す。最初に2回だけゆっくり点滅させる */
.portal-body-v2 .auth-card-apple.is-ready,
.portal-body-v2 .auth-card-google.is-ready {
    outline: 2px solid var(--v2-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--v2-accent-soft);
    animation: auth-card-ready 1.2s ease-in-out 2;
}

@keyframes auth-card-ready {
    0%, 100% { box-shadow: 0 0 0 6px var(--v2-accent-soft); }
    50% { box-shadow: 0 0 0 10px var(--v2-accent-soft); }
}

@media (prefers-reduced-motion: reduce) {
    .portal-body-v2 .auth-card-apple.is-ready,
    .portal-body-v2 .auth-card-google.is-ready {
        animation: none;
    }
}

/* LP signup/login/verify modals (formerly signup-modal.css; load order preserved). */
.lp-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    padding: 1.5rem 1rem 2.5rem;
}
.lp-footer a {
    color: inherit;
    opacity: 0.8;
    text-decoration: underline;
}

.lp-modal {
    width: min(480px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    border: none;
    border-radius: 16px;
    padding: 1.75rem;
    background: var(--panel-bg, #fff);
    color: inherit;
}
.lp-modal::backdrop {
    background: rgba(10, 10, 20, 0.55);
}
.lp-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}
.lp-modal h2 {
    margin: 0 0 0.5rem;
}
.lp-modal h3 {
    margin: 1rem 0 0.5rem;
}
.lp-required-note {
    display: block;
    margin: -0.25rem 0 0.75rem;
    font-size: 0.85em;
    font-weight: 400;
    opacity: 0.75;
}

.lp-modal .status[hidden] {
    display: none;
}

.field-error {
    margin: 4px 0 0;
    font-size: 12px;
    color: #b23c3c;
}
.field-error[hidden] {
    display: none;
}

.lp-consent-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.lp-consent-group .consent-check {
    margin: 0;
}

.lp-actions-full {
    margin-top: 1rem;
}
.lp-actions-full .btn-primary {
    width: 100%;
}

.lp-forgot-wrap {
    margin: 0.5rem 0 0;
    text-align: center;
    font-size: 13px; /* ボタンや入力欄より控えめに */
}
.btn-link {
    border: none;
    background: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    opacity: 0.85;
    cursor: pointer;
    font: inherit;
}

@media (max-width: 400px) {
    .lp-modal {
        width: 94vw;
        padding: 1.25rem;
    }
}


/* メール本人確認: 「仮パスワードを再送する」が2列の片側に入って折り返していた（2026-10-16）。行いっぱいに置き、ボタンの文字は改行しない */
.portal-body-v2 .lp-modal .verify-resend {
    grid-column: 1 / -1;
    margin: 0;
}

.portal-body-v2 .lp-modal .verify-resend .btn-secondary {
    white-space: nowrap;
}

/* 新しいパスワード: 強いパスワードを作るボタン（2026-10-30） */
.portal-body-v2 .lp-modal .verify-password-gen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 8px 0 0;
}

.portal-body-v2 .lp-modal .verify-password-gen .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
}

.portal-body-v2 .lp-modal .verify-password-gen-note {
    font-size: 12px;
    line-height: 1.6;
    color: var(--v2-muted);
}
