/*
 * Split sign-in screens shared by the dashboard and the publisher portal.
 * The form panel comes first in the markup, so the grid puts it on the
 * reading-start side (right in Arabic, left in English) and the photo after it.
 */
:root {
    --ax-navy: #0f2537;
    --ax-navy-2: #183650;
    --ax-red: #b8203a;
    --ax-red-2: #9c1a30;
    --ax-orange: #f39a1f;
    --ax-ink: #14202b;
    --ax-muted: #6b7480;
    --ax-line: #e4ded4;
    --ax-paper: #faf8f4;
    --ax-field: #ffffff;
    --ax-accent: var(--ax-navy);
    --ax-accent-hover: var(--ax-navy-2);
    --ax-badge-bg: #fbe3e2;
    --ax-badge-ink: #b8203a;
}

.ax-portal {
    --ax-accent: var(--ax-red);
    --ax-accent-hover: var(--ax-red-2);
    --ax-badge-bg: #fde9cf;
    --ax-badge-ink: #b4610a;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body.ax-body {
    margin: 0;
    background: var(--ax-paper);
    color: var(--ax-ink);
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.ax-shell {
    display: grid;
    grid-template-columns: minmax(400px, 36%) 1fr;
    min-height: 100vh;
}

/* ---------- form panel ---------- */

.ax-panel {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 28px 40px 22px;
    background: var(--ax-paper);
}

/* The curved edge spills over the photo; the path is drawn for the
   right-to-left layout and mirrored for left-to-right. */
.ax-curve {
    position: absolute;
    top: 0;
    inset-inline-end: -99px;
    width: 100px;
    height: 100%;
    fill: var(--ax-paper);
    pointer-events: none;
}

[dir="ltr"] .ax-curve { transform: scaleX(-1); }

.ax-lang {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 600;
}

.ax-lang a {
    position: relative;
    padding-bottom: 4px;
    color: var(--ax-muted);
    text-decoration: none;
}

.ax-lang a:hover { color: var(--ax-ink); }

.ax-lang a.is-active { color: var(--ax-ink); }

.ax-lang a.is-active::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ax-orange), var(--ax-red));
}

.ax-lang span {
    width: 1px;
    height: 14px;
    background: var(--ax-line);
}

.ax-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.ax-card {
    width: 100%;
    max-width: 400px;
}

.ax-brand {
    display: block;
    width: max-content;
    margin: 0 auto 18px;
}

.ax-brand img {
    display: block;
    height: 70px;
    width: auto;
}

.ax-badge {
    display: block;
    width: max-content;
    margin: 0 auto 14px;
    padding: 4px 16px;
    border-radius: 999px;
    background: var(--ax-badge-bg);
    color: var(--ax-badge-ink);
    font-size: 12.5px;
    font-weight: 600;
}

.ax-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 27px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ax-ink);
}

.ax-sub {
    margin: 0 0 26px;
    text-align: center;
    color: var(--ax-muted);
    font-size: 14.5px;
}

/* ---------- fields ---------- */

.ax-field { margin-bottom: 16px; }

.ax-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ax-ink);
}

.ax-input {
    position: relative;
    display: flex;
    align-items: center;
}

.ax-input > svg {
    position: absolute;
    inset-inline-start: 14px;
    width: 18px;
    height: 18px;
    color: #8a929c;
    pointer-events: none;
}

.ax-input input {
    width: 100%;
    height: 48px;
    padding-block: 0;
    padding-inline: 44px 14px;
    border: 1px solid var(--ax-line);
    border-radius: 9px;
    background: var(--ax-field);
    color: var(--ax-ink);
    font: inherit;
    font-size: 14.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ax-input input::placeholder { color: #a5abb3; }

.ax-input input:focus {
    outline: none;
    border-color: var(--ax-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ax-accent) 14%, transparent);
}

.ax-input.has-eye input { padding-inline-end: 46px; }

/* The address the link was issued for: shown, submitted, never edited. */
.ax-input.is-locked input {
    padding-inline-end: 44px;
    background: #f1ede6;
    border-color: #e9e3d9;
    color: var(--ax-ink);
    cursor: default;
    pointer-events: none;
    user-select: none;
}

.ax-input.is-locked > svg.ax-lock-end {
    inset-inline-start: auto;
    inset-inline-end: 14px;
    width: 16px;
    height: 16px;
}

.ax-eye {
    position: absolute;
    inset-inline-end: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8a929c;
    cursor: pointer;
}

.ax-eye:hover { color: var(--ax-ink); background: #f3efe8; }

.ax-eye svg { width: 18px; height: 18px; }

.ax-eye .ax-eye-off { display: none; }

.ax-eye.is-on .ax-eye-on { display: none; }

.ax-eye.is-on .ax-eye-off { display: block; }

.ax-hint {
    display: block;
    margin-top: 6px;
    color: var(--ax-muted);
    font-size: 12.5px;
}

/* Six boxes drawn over one real field, so paste and one-time-code autofill
   keep working. Codes read left-to-right in both languages. */
.ax-otp {
    position: relative;
    direction: ltr;
}

.ax-otp-cells {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.ax-otp-cells span {
    position: relative;
    display: grid;
    place-items: center;
    height: 58px;
    border: 1px solid var(--ax-line);
    border-radius: 10px;
    background: var(--ax-field);
    color: var(--ax-ink);
    font-size: 24px;
    font-weight: 700;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ax-otp-cells span.is-filled { border-color: #cdc5b8; }

.ax-otp-cells span.is-active {
    border-color: var(--ax-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ax-accent) 14%, transparent);
}

.ax-otp-cells span.is-active:empty::after {
    content: "";
    width: 2px;
    height: 24px;
    background: var(--ax-accent);
    animation: ax-caret 1s steps(1) infinite;
}

@keyframes ax-caret { 50% { opacity: 0; } }

.ax-otp input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;
    letter-spacing: 0;
    outline: none;
    cursor: text;
}

.ax-otp input::selection { background: transparent; }

@media (max-width: 420px) {
    .ax-otp-cells { gap: 7px; }

    .ax-otp-cells span { height: 52px; font-size: 21px; }
}

.ax-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 20px;
    font-size: 13.5px;
}

.ax-row.is-end { justify-content: flex-end; }

.ax-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ax-ink);
    cursor: pointer;
    user-select: none;
}

.ax-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--ax-accent);
    cursor: pointer;
}

.ax-link {
    color: var(--ax-red);
    font-weight: 600;
    text-decoration: none;
}

.ax-link:hover { text-decoration: underline; }

/* ---------- buttons ---------- */

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

.ax-btn:hover { background: var(--ax-accent-hover); }

.ax-btn:active { transform: translateY(1px); }

.ax-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--ax-accent) 30%, transparent);
    outline-offset: 2px;
}

.ax-btn svg { width: 19px; height: 19px; }

[dir="rtl"] .ax-btn svg { transform: scaleX(-1); }

.ax-btn-text {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ax-accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ax-btn-text:hover:not(:disabled) { text-decoration: underline; }

.ax-btn-text:disabled {
    color: var(--ax-muted);
    cursor: not-allowed;
}

.ax-aside {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    font-size: 13.5px;
}

.ax-aside form { margin: 0; }

.ax-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ax-muted);
    font-weight: 600;
    text-decoration: none;
}

.ax-back:hover { color: var(--ax-ink); }

.ax-back svg { width: 16px; height: 16px; }

[dir="rtl"] .ax-back svg { transform: scaleX(-1); }

.ax-aside.is-center { justify-content: center; }

.ax-foot {
    margin: 0;
    text-align: center;
    color: #8d949c;
    font-size: 12px;
}

.ax-foot a { color: inherit; text-decoration: underline; }

/* ---------- alerts (both partials) ---------- */

.ax-card .alert {
    margin: 0 0 18px !important;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13.5px;
    line-height: 1.65;
}

.ax-card .alert li { list-style: none; }

.ax-card .alert-danger,
.ax-card .alert-light-danger { background: #fdeef0; border-color: #f5cfd5; color: #8f1a2d; }

.ax-card .alert-success,
.ax-card .alert-light-success { background: #ebf7ef; border-color: #c7e8d2; color: #1d6b3a; }

.ax-card .alert-info,
.ax-card .alert-light-info { background: #eaf2fb; border-color: #c9dcf2; color: #1d4f86; }

.ax-card .alert-warning,
.ax-card .alert-light-warning { background: #fff5e3; border-color: #f6dfb1; color: #8a5300; }

/* ---------- photo panel ---------- */

.ax-hero {
    position: relative;
    overflow: hidden;
    background: #0b1620 center / cover no-repeat;
    color: #fff;
}

.ax-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 12, 20, 0) 38%, rgba(6, 12, 20, .55) 66%, rgba(6, 12, 20, .9) 100%);
}

.ax-portal .ax-hero::after {
    background:
        linear-gradient(180deg, rgba(10, 14, 20, 0) 34%, rgba(10, 14, 20, .5) 60%, rgba(10, 14, 20, .86) 100%);
}

.ax-hero-copy {
    position: absolute;
    z-index: 1;
    inset-inline: 132px 56px;
    bottom: 52px;
    text-align: start;
}

.ax-hero-title,
.ax-hero-lead,
.ax-feats { max-width: 640px; }

.ax-hero-title {
    margin: 0;
    font-size: clamp(30px, 3.1vw, 46px);
    font-weight: 700;
    line-height: 1.32;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.ax-hero-title span { display: block; }

.ax-hero-bar {
    width: 56px;
    height: 4px;
    margin: 22px 0 16px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ax-orange) 0 50%, var(--ax-red) 50% 100%);
}

.ax-hero-meta {
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 16px;
    letter-spacing: .3px;
}

.ax-hero-lead {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .9);
    font-size: clamp(16px, 1.45vw, 21px);
}

.ax-feats {
    display: flex;
    margin: 30px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    list-style: none;
}

.ax-feats li {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding-inline: 18px;
    color: rgba(255, 255, 255, .92);
    font-size: 14.5px;
    font-weight: 500;
}

.ax-feats li:first-child { padding-inline-start: 0; }

.ax-feats li + li { border-inline-start: 1px solid rgba(255, 255, 255, .22); }

.ax-feats svg {
    flex: none;
    width: 24px;
    height: 24px;
    color: #fff;
}

/* ---------- small screens ---------- */

@media (max-width: 991.98px) {
    .ax-shell { grid-template-columns: 1fr; }

    .ax-hero,
    .ax-curve { display: none; }

    .ax-panel { padding: 22px 22px 18px; }
}

@media (max-width: 420px) {
    .ax-brand img { height: 52px; }

    .ax-title { font-size: 23px; }

    .ax-sub { margin-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .ax-btn, .ax-input input, .ax-otp-cells span { transition: none; }

    .ax-otp-cells span.is-active:empty::after { animation: none; }
}
