/* ExpressCare guest auth pages (login, register, password reset). */

.ec-auth {
    --ec-primary: #0f766e;
    --ec-primary-hover: #0b5f58;
    --ec-primary-soft: #e6f4f2;
    --ec-ink: #0f172a;
    --ec-text: #334155;
    --ec-muted: #64748b;
    --ec-border: #dbe3ea;
    --ec-surface: #ffffff;
    --ec-bg: #f5f8fa;
    --ec-danger: #dc2626;
    --ec-radius: 12px;

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    background: var(--ec-bg);
    color: var(--ec-text);
    font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
}

/* The template sets its own heading font; keep one family across the page. */
.ec-auth h1,
.ec-auth h2,
.ec-auth .ec-label { font-family: inherit; }

@media (min-width: 992px) {
    .ec-auth {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
}

/* ---------- Logo ---------- */

.ec-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.ec-logo__mark {
    width: 36px;
    height: 36px;
    flex: none;
}

.ec-logo__text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.ec-logo--dark .ec-logo__mark rect { fill: var(--ec-primary); }
.ec-logo--dark .ec-logo__mark path { fill: #fff; }
.ec-logo--dark .ec-logo__text { color: var(--ec-ink); }

.ec-logo--light .ec-logo__mark rect { fill: #fff; }
.ec-logo--light .ec-logo__mark path { fill: var(--ec-primary); }
.ec-logo--light .ec-logo__text { color: #fff; }

/* ---------- Brand panel ---------- */

.ec-auth__brand {
    display: none;
    position: relative;
    overflow: hidden;
    color: #fff;
    background-color: #0b4f4a;
    background-image:
        radial-gradient(circle at 85% 10%, rgba(94, 234, 212, 0.28), transparent 45%),
        radial-gradient(circle at 10% 95%, rgba(20, 184, 166, 0.35), transparent 50%),
        linear-gradient(160deg, #0b4f4a 0%, #0f766e 60%, #12968b 100%);
}

/* Faint grid of medical crosses. */
.ec-auth__brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M26 22h4v4h4v4h-4v4h-4v-4h-4v-4h4z' fill='%23ffffff' fill-opacity='0.07'/%3E%3C/svg%3E");
    pointer-events: none;
}

@media (min-width: 992px) {
    .ec-auth__brand { display: block; }
}

.ec-auth__brand-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    height: 100%;
    padding: 48px clamp(32px, 5vw, 72px);
}

.ec-auth__pitch {
    max-width: 440px;
}

.ec-auth__pitch h2 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(28px, 2.6vw, 38px);
    font-weight: 700;
    line-height: 1.25;
}

.ec-auth__pitch p {
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.7;
}

.ec-auth__points {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ec-auth__points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.ec-auth__points i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 18px;
}

.ec-auth__brand-foot {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* ---------- Form panel ---------- */

.ec-auth__main {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 24px 16px;
}

@media (min-width: 576px) {
    .ec-auth__main { padding: 32px; }
}

.ec-auth__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 440px;
}

@media (min-width: 992px) {
    .ec-auth__topbar {
        justify-content: flex-end;
        max-width: none;
    }

    .ec-auth__mobile-logo { display: none; }
}

.ec-auth__lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--ec-border);
    border-radius: 999px;
    background: var(--ec-surface);
    color: var(--ec-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.ec-auth__lang:hover { color: var(--ec-primary); border-color: var(--ec-primary); }

.ec-auth__panel {
    width: 100%;
    max-width: 440px;
    margin-block: auto;
    padding-block: 32px;
}

.ec-auth__head { margin-bottom: 28px; }

.ec-auth__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: var(--ec-primary-soft);
    color: var(--ec-primary);
    font-size: 26px;
}

.ec-auth__head h1 {
    margin: 0 0 8px;
    color: var(--ec-ink);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
}

.ec-auth__head p {
    margin: 0;
    color: var(--ec-muted);
    line-height: 1.6;
}

.ec-auth__foot {
    margin: 0;
    color: var(--ec-muted);
    font-size: 13px;
}

@media (min-width: 992px) {
    .ec-auth__foot { display: none; }
}

.ec-auth .alert {
    border-radius: 10px;
    font-size: 14px;
}

/* ---------- Fields ---------- */

.ec-field { margin-bottom: 18px; }

.ec-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.ec-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ec-ink);
    font-size: 14px;
    font-weight: 600;
}

.ec-link {
    color: var(--ec-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.ec-link:hover { color: var(--ec-primary-hover); text-decoration: underline; }

.ec-input-wrap { position: relative; }

.ec-input-wrap > .ec-input-icon {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 14px;
    display: flex;
    align-items: center;
    color: var(--ec-muted);
    font-size: 18px;
    pointer-events: none;
}

.ec-input {
    display: block;
    width: 100%;
    height: 48px;
    padding-inline: 14px;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    background: var(--ec-surface);
    color: var(--ec-ink);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.ec-input-wrap > .ec-input-icon ~ .ec-input { padding-inline-start: 44px; }
.ec-input-wrap--toggle .ec-input { padding-inline-end: 48px; }

.ec-input::placeholder { color: #94a3b8; }

.ec-input:focus {
    outline: none;
    border-color: var(--ec-primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.ec-input.is-invalid { border-color: var(--ec-danger); }
.ec-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }

/* app-rtl.css forces tel inputs to LTR, which puts the text under the icon. */
.ec-auth .ec-input[type="tel"] {
    direction: inherit;
    text-align: start;
}

.ec-input--code {
    /* Digits read left-to-right, even in Arabic. */
    direction: ltr;
    height: 60px;
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.6em;
    padding-inline-start: calc(14px + 0.6em);
}

.ec-input--code::placeholder {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: normal;
}

.ec-toggle-pass {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 4px;
    display: grid;
    place-items: center;
    width: 44px;
    border: 0;
    background: none;
    color: var(--ec-muted);
    font-size: 20px;
    cursor: pointer;
}

.ec-toggle-pass:hover { color: var(--ec-ink); }

.ec-toggle-pass:focus-visible {
    outline: 2px solid var(--ec-primary);
    outline-offset: -6px;
    border-radius: 8px;
}

.ec-error {
    display: block;
    margin-top: 6px;
    color: var(--ec-danger);
    font-size: 13px;
}

.ec-hint {
    margin-top: 6px;
    color: var(--ec-muted);
    font-size: 13px;
}

/* ---------- Portal switch (login type) ---------- */

.ec-segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    background: #eef2f5;
}

.ec-segment__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ec-segment__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 9px;
    color: var(--ec-muted);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color .15s, color .15s, box-shadow .15s;
}

.ec-segment__label i { font-size: 18px; }

.ec-segment__label:hover { color: var(--ec-ink); }

.ec-segment__input:checked + .ec-segment__label {
    background: var(--ec-surface);
    color: var(--ec-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.ec-segment__input:focus-visible + .ec-segment__label {
    outline: 2px solid var(--ec-primary);
    outline-offset: 1px;
}

/* ---------- Checkbox, buttons, footer links ---------- */

.ec-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--ec-text);
    font-size: 14px;
    cursor: pointer;
}

.ec-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ec-primary);
}

.ec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    background: var(--ec-primary);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, transform .05s;
}

.ec-btn:hover { background: var(--ec-primary-hover); }
.ec-btn:active { transform: translateY(1px); }

.ec-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.25);
}

[dir="rtl"] .ec-btn .bx-right-arrow-alt { transform: scaleX(-1); }

.ec-btn-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.ec-alt {
    margin: 24px 0 0;
    color: var(--ec-muted);
    font-size: 14px;
    text-align: center;
}

.ec-alt .ec-link { font-size: 14px; }

.ec-resend {
    margin-top: 16px;
    text-align: center;
}
