/*
 * Auth pages (Figma: Nezam Plus › Login/ register)
 * Login Page 2003:2337 / 2006:65 · Add Acount 2009:2 / 2010:372
 * Used by: admin login, select-account (register).
 */

.grecaptcha-badge { visibility: hidden !important; display: none !important; }

:root {
    --lp-primary: #24a68a;   /* Dark Aquamarine */
    --lp-accent: #a8cc48;    /* Comforting Green Yellow */
    --lp-dark: #123b3a;      /* Pine Forest */
    --lp-ink: #1e2233;
    --lp-gray: #8391a2;
    --lp-muted: #a1a9b1;
    --lp-danger: #e63946;
    --lp-field: #f3f3f3;
    --lp-border: #f0f0f0;
}

html, body { background: #fff !important; }
body, body button, body input, body label, body p, body a, body h1, body h2, body h3, body span {
    font-family: 'Cairo', sans-serif !important;
}

/* Page shell: card on the left, brand art on the right (same in both locales) */
.lp-shell {
    direction: ltr;
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 29px;
    gap: 29px;
}
.lp-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lp-art {
    flex: 0 0 694px;               /* Figma panel width (shrinks only below 1200px, see media query) */
    width: 694px;
    min-width: 0;
    position: sticky;
    top: 29px;
    align-self: flex-start;
    height: min(924px, calc(100vh - 58px)); /* Figma 924px tall, but never taller than the screen (no page scroll) */
    border-radius: 18px;           /* Figma frame 2003:2390 */
    overflow: hidden;
}
.lp-art { background: var(--lp-primary); isolation: isolate; }
.lp-art img { display: block; width: 100%; height: 100%; }
/* waves: exact Figma vectors, anchored bottom-right (preserveAspectRatio xMaxYMax slice) so a shorter
   window never distorts them */
.lp-art-waves {
    position: absolute;
    right: 0;
    width: 694px;
    height: 924px;
    /* at the Figma height (924) the waves sit exactly as designed; on a shorter panel they keep their size
       and move down by half of the missing height, so they stay clear of the logo */
    bottom: calc(50% - 462px);
    display: block;
}
/* animated logo: transparent GIF 1454x722 whose finished logo is 744x550 at (158, 48).
   Scaled x0.6304 => logo 469x350 at (114, 204) of the 694x924 panel, exactly Figma's group. */
.lp-art .lp-art-gif {
    position: absolute;
    left: calc(50% - 332.6px);       /* = 14.4px on the 694px panel; stays centred if the panel narrows */
    top: calc(41.02% - 203.6px);     /* logo centre at 379/924 of the panel height (= 173.7px at 924) */
    width: 916.6px;
    height: 455.2px;
    max-width: none;
    pointer-events: none;
    user-select: none;
}
@media (max-width: 1199.98px) {
    .lp-art { flex: 0 1 694px; }
    .lp-main { min-width: min(420px, 100%); }
}

/* Card */
.lp-card {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border: 1px solid var(--lp-border);
    border-radius: 16px;
    box-shadow: 0 2px 19px 15px rgba(0, 0, 0, .02);
    padding: 16px 16px 18px;
    color: #27272a;
}
.lp-stack { display: flex; flex-direction: column; gap: 29px; }

/* Language bar */
.lp-lang {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 4px;
    height: 41px;
    border-bottom: .8px solid var(--lp-border);
}
[dir="rtl"] .lp-lang { justify-content: flex-start; }
.lp-lang a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 28px;
    padding: 0 8px;
    border-radius: 2px;
    font-size: 12.75px;
    font-weight: 600;
    line-height: 19.5px;
    color: #9f9fa9;
    transition: color .15s;
}
.lp-lang a:hover { color: var(--lp-dark); }
.lp-lang a.is-active {
    background: var(--lp-accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 48px rgba(56, 65, 74, .03);
}

/* Heading */
.lp-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 40px; text-align: center; }
.lp-title { font-size: 20px; font-weight: 700; line-height: 30px; color: var(--lp-ink); margin: 0; }
.lp-title--brand { color: var(--lp-dark); }
.lp-subtitle { font-size: 14px; line-height: 19.5px; color: var(--lp-gray); margin: 0; }

/* Fields */
.lp-fields { display: flex; flex-direction: column; gap: 18px; }
.lp-field { display: flex; flex-direction: column; gap: 8px; }
.lp-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    line-height: 21px;
    color: var(--lp-gray);
    text-align: start;
    margin: 0;
}
.lp-label .lp-req { color: var(--lp-danger); font-size: 13.75px; font-weight: 600; margin-inline-start: 4px; }
.lp-input-wrap { position: relative; }
.lp-input {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background: var(--lp-field);
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    line-height: 19.5px;
    color: #27272a;
    text-align: start;
    outline: none;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.lp-input::placeholder { color: var(--lp-muted); }
.lp-input:focus {
    background: #fff;
    border-color: var(--lp-accent);
    box-shadow: 0 4px 10px rgba(182, 217, 87, .24);
}
.lp-input--pw { padding-inline-end: 46px; }
.lp-eye {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 9px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: var(--lp-gray);
    background: none;
    border: 0;
    cursor: pointer;
}
.lp-eye:hover, .lp-eye.is-visible { color: var(--lp-primary); }
.lp-error { color: var(--lp-danger); font-size: 12px; margin: 0; }

/* Phone with country picker (intl-tel-input v19, showSelectedDialCode) */
.lp-phone .iti { display: block; width: 100%; }
.lp-phone .iti input.lp-input { direction: ltr; }
[dir="rtl"] .lp-phone .iti input.lp-input { text-align: right; }
.lp-phone .iti .iti__selected-flag {
    background: transparent !important;
    gap: 4px;
    padding: 0 10px;
    border-inline-end: 1.6px solid #fff;
    border-radius: 0;
}
.lp-phone .iti .iti__selected-flag:hover,
.lp-phone .iti .iti__selected-flag:focus { background: rgba(0, 0, 0, .03) !important; }
.lp-phone .iti__selected-dial-code { margin: 0; font-size: 14px; color: var(--lp-ink); direction: ltr; unicode-bidi: isolate; }
.lp-phone .iti__arrow {
    width: 15px;
    height: 15px;
    margin: 0;
    border: 0;
    background-color: var(--lp-ink);
    -webkit-mask: url('../images/auth-figma/chevron.svg') center / contain no-repeat;
    mask: url('../images/auth-figma/chevron.svg') center / contain no-repeat;
    order: -1;
}
.lp-phone .iti__arrow--up { transform: rotate(180deg); }
.lp-phone .iti__country-list { font-size: 13px; border-radius: 6px; border-color: var(--lp-border); }

/* Mask icons: keep the Figma SVG files intact while following currentColor */
.lp-icon {
    display: inline-block;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

/* Role selector */
.lp-roles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(229, 243, 255, .05);
}
.role-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 39px;
    min-width: 0;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid #eaeaea;
    background: #f9f9f9;
    color: var(--lp-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 15.6px;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.role-btn span { overflow: hidden; text-overflow: ellipsis; }
.role-btn:hover { color: var(--lp-dark); border-color: #dcdcdc; }
.role-btn.active { background: var(--lp-dark); border-color: var(--lp-dark); color: #fff; }

/* Remember / forgot */
.lp-actions { display: flex; flex-direction: column; gap: 20px; }
.lp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lp-remember { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.lp-check {
    appearance: none;
    -webkit-appearance: none;
    width: 17.6px;
    height: 18.4px;
    margin: 0;
    border-radius: 4px;
    border: 1px solid #dfe3e8;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.lp-check:checked {
    border-color: var(--lp-accent);
    background: var(--lp-accent) url('../images/auth-figma/check.png') center / cover no-repeat;
}
.lp-check:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }
.lp-remember-text { font-size: 13px; font-weight: 600; line-height: 19.5px; color: #aab8c5; }
.lp-link-muted { font-size: 13px; line-height: 19.5px; color: var(--lp-gray); text-decoration: underline; }
.lp-link-muted:hover { color: var(--lp-primary); }

.lp-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44.8px;
    border: 0;
    border-radius: 6px;
    background: var(--lp-primary);
    color: #fff !important;
    font-size: 18px;
    line-height: 19.5px;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s;
}
.lp-submit:hover { filter: brightness(.94); }

.lp-register { margin: 20px 0 0; text-align: center; font-size: 14px; line-height: 21px; color: var(--lp-gray); }
.lp-register a { color: var(--lp-primary); text-decoration: underline; }

/* Institution panel on the register page */
.lp-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: 12px;
    background: #f9f9f9;
    border: 1px solid #eaeaea;
    text-align: center;
}
.lp-panel .lp-icon { color: var(--lp-dark); }
.lp-card .hidden { display: none !important; }
.lp-panel p { margin: 0 0 4px; font-size: 14px; line-height: 21px; color: var(--lp-gray); }

/* Password recovery pages (forgot / verify code / reset) */
.lp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(36, 166, 138, .1);
    color: var(--lp-primary);
    font-size: 20px;
}
.lp-badge--wa { background: rgba(168, 204, 72, .18); color: #5f7f12; font-size: 24px; }
.lp-hint { margin: 0; font-size: 12px; line-height: 18px; color: var(--lp-muted); text-align: start; }
.lp-note { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--lp-gray); }
.lp-note i { color: #25d366; font-size: 15px; }

.lp-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    text-align: start;
}
.lp-alert i { margin-top: 3px; flex-shrink: 0; }
.lp-alert ul { margin: 0; padding-inline-start: 16px; list-style: disc; }
.lp-alert--success { background: rgba(36, 166, 138, .08); border: 1px solid rgba(36, 166, 138, .3); color: #17785f; }
.lp-alert--error { background: rgba(230, 57, 70, .07); border: 1px solid rgba(230, 57, 70, .3); color: #c62835; }

.lp-phone-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--lp-field);
    font-size: 13px;
    font-weight: 700;
    color: var(--lp-ink);
    direction: ltr;
}
.lp-phone-pill i { color: #25d366; }

.lp-otp { display: flex; justify-content: center; gap: 8px; direction: ltr; }
.lp-otp input {
    width: 48px;
    height: 54px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--lp-field);
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--lp-ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.lp-otp input:focus { background: #fff; border-color: var(--lp-accent); box-shadow: 0 4px 10px rgba(182, 217, 87, .24); }
.lp-otp input.filled { background: #fff; border-color: var(--lp-primary); }

.lp-resend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: .8px solid var(--lp-border);
    font-size: 13px;
    color: var(--lp-gray);
    text-align: center;
}
.lp-resend p { margin: 0; }
.lp-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--lp-primary);
    cursor: pointer;
}
.lp-resend-btn:disabled { color: var(--lp-muted); cursor: not-allowed; }
.lp-resend-btn .lp-count { padding: 1px 6px; border-radius: 4px; background: var(--lp-field); font-size: 11px; direction: ltr; }
.lp-resend a { color: var(--lp-primary); font-weight: 600; text-decoration: underline; }

.lp-back { margin: 20px 0 0; text-align: center; }
.lp-back a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--lp-gray); }
.lp-back a:hover { color: var(--lp-primary); }

@media (max-width: 420px) {
    .lp-otp { gap: 6px; }
    .lp-otp input { width: 40px; height: 48px; font-size: 19px; }
}

/* Footer */
.lp-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 34px;
    font-size: 13px;
    line-height: 19.5px;
    color: var(--lp-gray);
    direction: ltr;
}
.lp-footer img { display: block; width: 107px; height: 10px; }

/* Responsive */
@media (max-width: 1023.98px) {
    .lp-shell { padding: 24px 16px; }
    .lp-art { display: none; }
}
@media (max-width: 480px) {
    .lp-head { padding: 0 8px; }
    .role-btn { flex-direction: column; gap: 3px; height: auto; min-height: 50px; padding: 6px 2px; font-size: 12px; }
    .role-btn span { white-space: normal; text-align: center; line-height: 1.25; }
    .lp-row { flex-wrap: wrap; }
}
