/* ============================================================
   דפי כניסה, הרשמה, שכחתי סיסמה ואיפוס סיסמה — עמוד ענבר ולילה.
   נטען אחרי style.css. כל הצבעים מגיעים מהטוקנים (var(--pp-...)).
   ============================================================ */

:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--pp-color-bg);
    color: var(--pp-color-text);
    font-family: var(--pp-font-sans);
    font-size: 15px;
    line-height: 1.5;
}

[hidden] { display: none !important; }

/* ─── פריסה: עמודה אחת במרכז (הרשמה, שכחתי סיסמה, איפוס) ─── */
.auth-center {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* ─── פריסה: שתי עמודות (כניסה). מתחת ל-800px הלוח הענבר יורד לרצועה מתחת לטופס ─── */
.auth-split {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
}
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 32px;
}

/* ─── עמודת הטופס ─── */
.auth-col {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}
.auth-col-wide { max-width: 400px; }

/* ─── לוגו ─── */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pp-color-text);
}
.auth-brand-text { display: flex; flex-direction: column; gap: 4px; }
.auth-wordmark {
    font-family: var(--pp-font-display);
    font-size: 24px;
    line-height: 1;
    letter-spacing: -0.01em;
}
.auth-brand-sub {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--pp-color-text-disabled);
}

/* ─── כותרת ─── */
.auth-page .auth-title {
    margin: 0;
    font-family: var(--pp-font-display);
    font-weight: 900;
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--pp-color-text);
}
.auth-page .auth-lead {
    margin: 6px 0 0;
    font-size: 16px;
    color: var(--pp-color-text-muted);
}
.auth-page .auth-lead strong { color: var(--pp-color-text); font-weight: 600; }

/* ─── הודעות ─── */
.auth-flashes { display: flex; flex-direction: column; gap: 10px; }
.auth-page .flash {
    margin: 0;
    padding: 12px 16px;
    border-radius: var(--pp-radius-sm);
    border: 1px solid var(--pp-color-border);
    background: var(--pp-color-surface-subtle);
    color: var(--pp-color-text);
    font-size: 14px;
}
.auth-page .flash-error {
    background: var(--pp-tone-danger-bg);
    color: var(--pp-tone-danger-fg);
    border-color: var(--pp-color-danger-600);
}
.auth-page .flash-success {
    background: var(--pp-tone-success-bg);
    color: var(--pp-tone-success-fg);
    border-color: var(--pp-color-success-600);
}
.auth-page .flash-warning {
    background: var(--pp-tone-warning-bg);
    color: var(--pp-tone-warning-fg);
    border-color: var(--pp-color-warning-600);
}
.auth-page .flash-info {
    background: var(--pp-tone-cyan-bg);
    color: var(--pp-tone-cyan-fg);
    border-color: var(--pp-color-info-600);
}

/* ─── טופס ─── */
.auth-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--pp-color-text);
}
.auth-field input {
    width: 100%;
    max-width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 18px;
    border-radius: 16px;
    border: 1px solid var(--pp-color-border-strong);
    background: var(--pp-color-surface);
    color: var(--pp-color-text);
    font: inherit;
    font-size: 16px;
    font-weight: 400;
    transition: border-color var(--pp-motion-base) var(--pp-ease),
                box-shadow var(--pp-motion-base) var(--pp-ease);
}
.auth-field input[type="email"] { direction: ltr; text-align: right; }
.auth-field input::placeholder { color: var(--pp-color-text-disabled); opacity: 1; }
.auth-field input:focus {
    outline: none;
    border-color: var(--pp-focus-ring);
    box-shadow: var(--pp-focus);
}
/* מילוי אוטומטי של הדפדפן לא צובע את השדה בצבע זר */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--pp-color-text);
    caret-color: var(--pp-color-text);
    box-shadow: 0 0 0 1000px var(--pp-color-surface) inset;
}
.auth-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--pp-color-text);
    box-shadow: 0 0 0 1000px var(--pp-color-surface) inset, var(--pp-focus);
}
.auth-hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--pp-color-text-disabled);
}

/* ─── הצגה והסתרה של סיסמה ─── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 52px; }
.auth-page .pw-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 4px;
    width: 44px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: var(--pp-radius-pill);
    color: var(--pp-color-text-disabled);
    cursor: pointer;
    transition: color var(--pp-motion-fast) var(--pp-ease);
}
.auth-page .pw-toggle:hover { color: var(--pp-color-text); }
.auth-page .pw-toggle:active { transform: none; }
.auth-page .pw-toggle:focus-visible { outline: 2px solid var(--pp-focus-ring); outline-offset: -2px; }
.pw-toggle > span { display: inline-flex; }

/* ─── קישור "שכחתי סיסמה" מתחת לשדה הסיסמה ─── */
.auth-page .auth-forgot {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: -12px 0 -10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pp-color-brand-700);
    text-decoration: none;
}
.auth-page .auth-forgot:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─── הפעולה הראשית: כפתור ענבר ─── */
.auth-page .auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    margin: 6px 0 0;
    padding: 0 24px;
    border: 0;
    border-radius: var(--pp-radius-pill);
    background: var(--pp-amber);
    color: var(--pp-on-brand);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--pp-motion-fast) var(--pp-ease),
                background-color var(--pp-motion-base) var(--pp-ease);
}
.auth-page .auth-submit:hover { background: var(--pp-amber-hi); color: var(--pp-on-brand); }
.auth-page .auth-submit:active { transform: scale(0.97); }
.auth-page .auth-submit:focus-visible { outline: 2px solid var(--pp-focus-ring); outline-offset: 3px; }

/* ─── "או", כניסה עם Google, קישורים משניים ─── */
.auth-more { display: flex; flex-direction: column; gap: 18px; }
.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--pp-color-text-disabled);
}
.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pp-color-border);
}
.auth-page .auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--pp-color-border-strong);
    border-radius: var(--pp-radius-pill);
    background: var(--pp-color-surface);
    color: var(--pp-color-text);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    transition: transform var(--pp-motion-fast) var(--pp-ease),
                background-color var(--pp-motion-base) var(--pp-ease),
                border-color var(--pp-motion-base) var(--pp-ease);
}
.auth-page .auth-google:hover {
    background: var(--pp-color-surface-subtle);
    box-shadow: var(--pp-shadow-sm);
    color: var(--pp-color-text);
}
.auth-page .auth-google:active { transform: scale(0.98); }
.auth-page .auth-google:focus-visible { outline: 2px solid var(--pp-focus-ring); outline-offset: 3px; }
.auth-google svg { flex: none; }

.auth-page .auth-alt {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: var(--pp-color-text-muted);
}
.auth-page .auth-alt a {
    display: inline-block;
    padding: 6px 2px;
    font-weight: 600;
    color: var(--pp-color-brand-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ─── שדה פיתוי לבוטים. בני אדם לא רואים, בוטים ממלאים ─── */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ─── הלוח הענבר (כניסה בלבד) ─── */
.auth-aside {
    margin: 0 16px 16px;
    padding: 28px 24px;
    border-radius: var(--pp-radius-xl);
    background: var(--pp-amber-grad);
    color: var(--pp-ink);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}
.auth-aside-top { display: none; }
.auth-aside-top,
.auth-aside p { margin: 0; }
.auth-word {
    font-family: var(--pp-font-display);
    font-weight: 900;
    font-size: 72px;
    line-height: 0.95;
    letter-spacing: -0.03em;
}
.auth-slogan { font-size: 18px; font-weight: 700; line-height: 1.35; }
.auth-aside .auth-byline { margin-top: 6px; font-size: 14px; }

@media (min-width: 800px) {
    .auth-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        align-content: stretch;
    }
    .auth-main { padding: 56px 32px; }
    .auth-aside {
        margin: 16px;
        min-height: 360px;
        padding: clamp(32px, 5vw, 64px);
        gap: 32px;
    }
    .auth-aside-top {
        display: block;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.06em;
    }
    .auth-word { font-size: clamp(80px, 12vw, 176px); }
    .auth-slogan { font-size: 22px; }
    .auth-aside .auth-byline { margin-top: 8px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *, .auth-page *::before, .auth-page *::after { transition: none !important; }
}
