/* ==========================================================================
   Identity / OTP request popup — TypeOfNotebooks/Details (both notebook types)
   Scope: .saf-modal--identity only. The generic .saf-modal rules in
   site-styles*.css / auto-mobile*.css are left untouched; the few `!important`s
   here answer `!important`s in those sheets' mobile .saf-modal-content rules.
   Colours are the site's button tokens (a.goldeb-btn #28a850 / hover #21672e).
   ========================================================================== */

.saf-modal.saf-modal--identity {
    --im-green: #28a850;
    --im-green-hover: #21672e;
    --im-green-ink: #1c6b35;
    --im-green-soft: #eaf6ee;
    --im-ink: #1f2b2a;
    --im-muted: #66706c;
    --im-border: #d8dedb;
    position: fixed;
    inset: 0;
    z-index: 2000;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(8, 20, 14, .58);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    direction: rtl;
    animation: im-fade .22s ease both;
}
html[dir="ltr"] .saf-modal.saf-modal--identity { direction: ltr; }

/* ---- Card ---- */
.saf-modal--identity .saf-modal-content.identity-request-modal {
    position: relative;
    box-sizing: border-box;
    width: calc(100% - 32px) !important;
    max-width: 560px !important;
    margin: max(24px, 10vh) auto 24px;
    padding: 32px !important;
    background: #fff;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .18);
    text-align: center;
    animation: im-rise .26s cubic-bezier(.2, .7, .2, 1) both;
}

/* ---- Close ---- */
.saf-modal--identity .identity-request-modal__close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    float: none;
    margin: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f3f2;
    color: var(--im-ink);
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease;
}
.saf-modal--identity .identity-request-modal__close svg { width: 18px; height: 18px; }
.saf-modal--identity .identity-request-modal__close:hover { background: #e3e7e5; }

/* ---- Visual ---- */
.saf-modal--identity .identity-request-modal__icon {
    width: 76px;
    height: 76px;
    margin: 4px auto 18px;
    border-radius: 50%;
    background: var(--im-green-soft);
    color: var(--im-green);
    display: flex;
    align-items: center;
    justify-content: center;
}
.saf-modal--identity .identity-request-modal__icon svg { width: 38px; height: 38px; }

/* ---- Text ---- */
.saf-modal--identity .identity-request-modal__title {
    margin: 0 0 8px;
    font-size: clamp(24px, 1.6vw + 16px, 30px);
    font-weight: 800;
    line-height: 1.4;
    color: var(--im-ink);
    text-align: center;
}
.saf-modal--identity .identity-request-modal__subtitle {
    margin: 0 auto 26px;
    max-width: 400px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--im-muted);
    text-align: center;
}

/* ---- Form (vertical flow) ---- */
.saf-modal--identity .identity-request-modal__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: start;
}
.saf-modal--identity .identity-request-modal__label {
    font-size: 15px;
    font-weight: 700;
    color: var(--im-ink);
    margin: 0;
}
.saf-modal--identity .identity-request-modal__field { position: relative; }
.saf-modal--identity .identity-request-modal__field-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 16px;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    color: #8a948f;
    pointer-events: none;
    transition: color .15s ease;
}
.saf-modal--identity .identity-request-modal__field input.form-control {
    height: 54px;
    width: 100%;
    margin: 0;
    padding: 0 16px;
    padding-inline-start: 50px;
    border: 1px solid var(--im-border);
    border-radius: 12px;
    background: #fff;
    color: var(--im-ink);
    font-size: 16px;
    text-align: start;
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.saf-modal--identity .identity-request-modal__field input::-webkit-outer-spin-button,
.saf-modal--identity .identity-request-modal__field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.saf-modal--identity .identity-request-modal__field input::placeholder { color: #9aa39f; }
.saf-modal--identity .identity-request-modal__field input:focus {
    outline: none;
    border-color: var(--im-green);
    box-shadow: 0 0 0 4px rgba(40, 168, 80, .15);
}
.saf-modal--identity .identity-request-modal__field:focus-within .identity-request-modal__field-icon { color: var(--im-green); }
.saf-modal--identity .identity-request-modal__error { font-size: 13px; line-height: 1.6; }

.saf-modal--identity .goldeb-btn.identity-request-modal__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin: 10px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--im-green);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.saf-modal--identity .identity-request-modal__cta svg { width: 20px; height: 20px; transition: transform .15s ease; }
/* The arrow points forward: left in RTL, mirrored for LTR. */
html[dir="ltr"] .saf-modal--identity .identity-request-modal__cta svg { transform: scaleX(-1); }
.saf-modal--identity .goldeb-btn.identity-request-modal__cta:hover {
    background: var(--im-green-hover);
    box-shadow: 0 8px 20px -8px rgba(33, 103, 46, .55);
}
html[dir="rtl"] .saf-modal--identity .identity-request-modal__cta:hover svg { transform: translateX(-3px); }
.saf-modal--identity .identity-request-modal__cta:focus-visible,
.saf-modal--identity .identity-request-modal__close:focus-visible {
    outline: 3px solid rgba(40, 168, 80, .45);
    outline-offset: 2px;
}

/* ---- Notice ---- */
.saf-modal--identity .identity-request-modal__notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--im-green-soft);
    color: var(--im-muted);
    font-size: 14px;
    line-height: 1.7;
    text-align: start;
}
.saf-modal--identity .identity-request-modal__notice svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--im-green); margin-top: 2px; }

/* ---- Motion ---- */
@keyframes im-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes im-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes im-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes im-sink { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px); } }
.saf-modal--identity.is-closing { animation: im-fade-out .18s ease both; }
.saf-modal--identity.is-closing .identity-request-modal { animation: im-sink .18s ease both; }

@media (prefers-reduced-motion: reduce) {
    .saf-modal--identity,
    .saf-modal--identity .identity-request-modal { animation: none !important; }
}

/* ---- Mobile ---- */
@media (max-width: 575.98px) {
    .saf-modal--identity .saf-modal-content.identity-request-modal {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        margin-top: 12vh;
        padding: 28px 18px 20px !important;
        border-radius: 18px;
    }
    .saf-modal--identity .identity-request-modal__close { top: 12px; inset-inline-end: 12px; }
    .saf-modal--identity .identity-request-modal__icon { width: 64px; height: 64px; margin-bottom: 14px; }
    .saf-modal--identity .identity-request-modal__icon svg { width: 32px; height: 32px; }
    .saf-modal--identity .identity-request-modal__subtitle { font-size: 15px; margin-bottom: 20px; }
    .saf-modal--identity .identity-request-modal__field input.form-control,
    .saf-modal--identity .goldeb-btn.identity-request-modal__cta { height: 52px; }
}
