/* ============================================================
   password.css — the log-in page's card, method switch and
   password field, and the password page (create / add / reset / change).
   Tokens come from onboarding.css :root.
   ============================================================ */

/* Pieces login.blade.php styles inline; the password page needs them too. */
.ph-back {
    position: absolute; top: 14px; right: 18px;
    background: transparent; border: none;
    font-size: .88rem; font-weight: 700;
    color: var(--ink);
    cursor: pointer; padding: 6px 10px;
    border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
    z-index: 5;
}
.ph-back:hover { background: var(--peach-50); color: var(--coral-deep); }
.ph-back > span { font-weight: 800; }
.ph-eyebrow {
    display: block; text-align: center;
    font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .14em;
    color: var(--coral-deep);
    margin-top: 8px;
}
.hidden { display: none !important; }

/* The log-in card fits what is in it. The steps' fixed height left a blank
   strip under the button on a tall screen and hid the button on a short one. */
@media (min-width: 601px) {
    .phone.is-desktop.is-login {
        width: min(520px, calc(100vw - 40px));
        height: auto;
        min-height: 0;
    }
    .phone.is-desktop.is-login .s {
        padding: 8px 52px 36px;
    }
}

/* The two ways in: two choices under a label, drawn like the fields. */
.ph-method-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--ink-50);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
}
.ph-method {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ph-method-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-70);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.ph-method-btn svg { flex: none; }
.ph-method-btn:hover { border-color: var(--line-2); color: var(--ink); }
.ph-method-btn.is-on {
    border-color: var(--coral);
    background: var(--peach-50);
    color: var(--coral-deep);
}
.ph-method-btn:focus-visible {
    outline: 2px solid var(--coral);
    outline-offset: 2px;
}
@media (max-width: 767px) {
    .ph-method { gap: 8px; }
    .ph-method-btn { min-height: 42px; padding: 8px 10px; border-radius: 8px; font-size: .85rem; gap: 6px; }
}
/* "use my password" stays on one line on a small phone. */
@media (max-width: 400px) {
    .ph-method-btn { padding: 8px 6px; gap: 5px; font-size: .8rem; white-space: nowrap; }
}
@media (max-width: 340px) {
    .ph-method-btn svg { display: none; }
}

/* A password input with its show/hide word inside the border. */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 8px;
    font: inherit;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-50);
    cursor: pointer;
}
.pw-toggle:hover { color: var(--coral-deep); background: var(--peach-50); }
.pw-toggle:focus-visible { color: var(--coral-deep); background: var(--peach-50); outline: 2px solid var(--coral); }

/* The way to a new password: a small bold line, not a button. */
.ph-forgot-line { margin-top: 10px; }
.ph-forgot {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    color: var(--ink-70);
    text-decoration: underline;
    cursor: pointer;
}
.ph-forgot:hover { color: var(--coral-deep); }
.ph-forgot:focus-visible { color: var(--coral-deep); outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 4px; }

/* For password managers only: the account's number, never shown. */
.pw-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    opacity: 0;
}

/* Guidance, not a failure: the screen's own warm tint, no red. */
.ph-notice {
    font-size: .82rem;
    color: var(--ink-70);
    background: var(--peach-50);
    border: 1px solid var(--line);
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
}

/* The way out of an optional password page: small text under the button. */
.ph-skip-line {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink-50);
    text-decoration: none;
}
.ph-skip-line:hover, .ph-skip-line:focus-visible { color: var(--ink); text-decoration: underline; }

/* What a password needs, ticked as it is typed. */
.pw-rules {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: .72rem;
    color: var(--ink-50);
}
.pw-rules li::before { content: '\25CB\00A0'; }
.pw-rules li.ok { color: #2E7D5B; }
.pw-rules li.ok::before { content: '\25CF\00A0'; }
.pw-rules li.bad { color: var(--coral-deep); }
.pw-length-hint { color: var(--coral-deep); font-weight: 600; margin-top: 6px; }
.pw-wrap input[aria-invalid="true"] { border-color: var(--coral); }
