/* =====================================================================
   auth.css — חלון "כניסת מנויים", בחירת פרופיל, התראות והרשמה
   אותה שפה עיצובית של חלון הכניסה באתר התרגולים הראשי (שלב אימייל →
   שלב סיסמה, שדות עם תווית צפה, כפתור כחול מלא, "זכור אותי").
   ===================================================================== */
.auth-overlay {
    position: fixed; inset: 0; z-index: 20000;
    background: rgba(15, 23, 42, .62);
    display: none; align-items: center; justify-content: center;
    padding: 18px; overflow-y: auto;
    font-family: 'Heebo', 'Rubik', sans-serif; direction: rtl;
}
.auth-overlay.open { display: flex; animation: authFade .2s ease; }
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
body.auth-locked { overflow: hidden; }
body.auth-gated main, body.auth-gated footer { filter: blur(4px); pointer-events: none; user-select: none; }

.auth-card {
    position: relative; width: 100%; max-width: 520px; margin: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
    border: 1px solid #e2e8f0; border-radius: 28px;
    padding: 44px 40px 34px; box-sizing: border-box; overflow: hidden;
    box-shadow: 0 30px 70px rgba(15, 23, 42, .35), 0 0 0 1px rgba(37, 99, 235, .06);
    text-align: right; color: #0f172a;
}
.auth-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, #1e3a8a, #2563eb, #38bdf8);
}
.auth-close {
    position: absolute; top: 18px; left: 18px; width: 38px; height: 38px; border-radius: 50%;
    border: none; background: #f1f5f9; color: #64748b; font-size: 1.2rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .2s;
}
.auth-close:hover { background: #ef4444; color: #fff; transform: rotate(90deg); }

.auth-head { text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #eef2f7; }
.auth-icon {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 70px; height: 70px; border-radius: 20px; margin-bottom: 10px; color: #fff; font-size: 1.7rem;
    background: linear-gradient(135deg, #1e3a8a, #2563eb, #38bdf8);
    box-shadow: inset 0 2px 3px rgba(255,255,255,.45), inset 0 -6px 10px rgba(0,0,0,.18), 0 12px 26px rgba(37, 99, 235, .35);
}
.auth-icon::after {
    content: ''; position: absolute; top: 3px; left: 8px; right: 8px; height: 40%;
    border-radius: 50% / 60%; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
}
.auth-title { font-size: 1.85rem; font-weight: 900; margin: 0 0 6px; color: #0f172a; }
.auth-sub { font-size: 1.05rem; font-weight: 600; color: #64748b; margin: 0; }

.auth-step { display: none; }
.auth-step.active { display: block; animation: authStepIn .3s ease; }
@keyframes authStepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.auth-field { position: relative; margin-bottom: 16px; }
.auth-input {
    width: 100%; box-sizing: border-box; padding: 19px 16px 8px; font-size: 1.05rem;
    border: 2px solid #cbd5e1; border-radius: 12px; background: #fff; color: #0f172a;
    font-family: inherit; transition: border-color .2s, box-shadow .2s; direction: rtl; text-align: right;
}
.auth-input[type=email], .auth-input.ltr { direction: ltr; text-align: right; }
.auth-input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); outline: none; }
.auth-label {
    position: absolute; right: 16px; top: 17px; font-size: 1rem; color: #94a3b8; font-weight: 600;
    pointer-events: none; transition: all .18s ease;
}
.auth-input:focus + .auth-label, .auth-input:not(:placeholder-shown) + .auth-label { top: 6px; font-size: .72rem; color: #2563eb; font-weight: 700; }
select.auth-input { -webkit-appearance: none; appearance: none; padding-top: 19px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2364748b" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat; background-position: left 10px center; }
select.auth-input + .auth-label { top: 6px; font-size: .72rem; color: #2563eb; font-weight: 700; }

.auth-btn {
    width: 100%; padding: 16px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%); color: #fff !important;
    font-size: 1.12rem; font-weight: 800; font-family: inherit; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 12px 28px rgba(29, 78, 216, .4); transition: all .25s cubic-bezier(.16, 1, .3, 1);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(29, 78, 216, .5); background: linear-gradient(135deg, #14276b 0%, #1e40af 100%); }
.auth-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.auth-btn2 {
    width: 100%; padding: 14px; border-radius: 12px; background: #fff; border: 2px solid #dbeafe;
    color: #1e3a8a; font-family: inherit; font-size: .98rem; font-weight: 700; cursor: pointer; transition: .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-sizing: border-box;
}
.auth-btn2:hover { background: #eff6ff; border-color: #93c5fd; }
.auth-divider { display: flex; align-items: center; margin: 18px 0; color: #94a3b8; font-size: .85rem; font-weight: 600; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.auth-divider span { padding: 0 12px; }
.auth-chip {
    display: flex; align-items: center; gap: 10px; background: #eff6ff; border: 1px solid #dbeafe;
    border-radius: 12px; padding: 11px 14px; margin-bottom: 18px; cursor: pointer;
}
.auth-chip i { color: #2563eb; }
.auth-chip .auth-chip-mail { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.auth-chip .auth-chip-change { color: #2563eb; font-size: .85rem; font-weight: 700; text-decoration: underline; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 18px; gap: 10px; flex-wrap: wrap; }
.auth-remember { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: .9rem; color: #64748b; }
.auth-remember input { width: 16px; height: 16px; accent-color: #2563eb; cursor: pointer; }
.auth-link { color: #2563eb; cursor: pointer; font-size: .92rem; text-decoration: underline; font-weight: 600; background: none; border: none; font-family: inherit; padding: 0; }
.auth-msg { display: none; margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; font-weight: 600; font-size: .95rem; line-height: 1.5; }
.auth-msg.err { display: block; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-msg.ok { display: block; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.auth-shake { animation: authShake .5s ease; border-color: #ef4444 !important; }
@keyframes authShake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.auth-spin { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: authSpin .7s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-profiles h3 { font-size: 1.5rem; font-weight: 800; text-align: center; margin: 0 0 18px; }
.auth-profile-btn {
    width: 100%; cursor: pointer; background: #f8fafc; color: #0f172a; padding: 18px; border-radius: 16px; margin-bottom: 10px;
    font-weight: 700; border: 1px solid #e2e8f0; transition: .25s; display: flex; align-items: center; gap: 16px;
    font-family: inherit; font-size: 1.15rem; text-align: right;
}
.auth-profile-btn:hover { border-color: #2563eb; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(37, 99, 235, .15); }
.auth-avatar { width: 46px; height: 46px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; flex-shrink: 0; }
.auth-profile-grade { margin-right: auto; background: #e2e8f0; color: #475569; font-size: .85rem; padding: 4px 12px; border-radius: 30px; }

/* התראה */
.auth-alert-card { max-width: 440px; padding: 34px 30px 26px; text-align: center; }
.auth-alert-card .auth-icon { width: 60px; height: 60px; font-size: 1.5rem; }
.auth-alert-text { font-size: 1.1rem; font-weight: 600; color: #1e293b; line-height: 1.6; margin: 6px 0 22px; white-space: pre-line; }

/* אזור המשתמש בכותרת */
.auth-user {
    display: inline-flex; align-items: center; gap: 8px; background: #eff6ff; color: #1e3a8a;
    border: 1.5px solid #dbeafe; border-radius: 50px; padding: 7px 14px; font-weight: 800; font-size: .88rem; white-space: nowrap;
}
.auth-user i { color: #2563eb; }
.header-btn.auth-out { background: #fff; color: #b91c1c; border: 1.5px solid #fecaca; box-shadow: none; }
.header-btn.auth-out:hover { background: #fef2f2; }
@media (max-width: 640px) {
    .auth-user .auth-user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 480px) {
    .auth-card { padding: 30px 20px 22px; border-radius: 22px; }
    .auth-title { font-size: 1.5rem; }
    .auth-icon { width: 56px; height: 56px; font-size: 1.35rem; }
    .auth-user { padding: 7px 10px; }
    .auth-user .auth-user-hello { display: none; }
}
