/* =============================================================================
   AUTH — part of the PaxLes PROTOKDOC system
   Same tokens, same grammar, same restraint as the landing page.
   The difference is material, not decoration: the form sits on a drafting
   sheet (paper) and the product context stays on the graphite ground, so
   authentication reads as a distinct document inside the same product.

   Scoped to body.ir-auth. landing.css is not imported or modified.
   ========================================================================== */

body.ir-auth {
    --ir-void: #0a0c0b;
    --ir-void-2: #0d100e;
    --ir-panel: #101412;
    --ir-ink: #e9f1ec;
    --ir-dim: #8a9a90;
    --ir-dimmer: #5d6b62;
    --ir-live: #34d27e;
    --ir-brand: #1c7a4c;
    --ir-warn: #e0a33c;
    --ir-rule: rgba(214, 236, 224, 0.14);
    --ir-rule-soft: rgba(214, 236, 224, 0.07);
    --ir-rule-hard: rgba(214, 236, 224, 0.26);
    --ir-paper: #f2f1ea;
    --ir-paper-2: #e7e5db;
    --ir-paper-ink: #10140f;
    --ir-paper-dim: #5d6357;
    --ir-paper-rule: rgba(16, 20, 15, 0.18);
    --ir-paper-rule-soft: rgba(16, 20, 15, 0.09);
    --ir-danger: #a1402f;
    --ir-font: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ir-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    background: var(--ir-void);
    color: var(--ir-ink);
    font-family: var(--ir-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    min-height: 100vh;
}

body.ir-auth .container {
    max-width: 1240px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

body.ir-auth a:focus-visible,
body.ir-auth button:focus-visible,
body.ir-auth input:focus-visible,
body.ir-auth select:focus-visible,
body.ir-auth summary:focus-visible {
    outline: 2px solid var(--ir-live);
    outline-offset: 2px;
}

body.ir-auth ::selection {
    background: var(--ir-live);
    color: var(--ir-void);
}

/* --- chrome ------------------------------------------------------------- */

body.ir-auth .minimal-preloader { background: var(--ir-void); }

body.ir-auth .minimal-preloader__dot {
    background: var(--ir-live);
    border-radius: 0;
    animation: ir-auth-blink 1.1s steps(2, end) infinite;
}

@keyframes ir-auth-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: .15; }
}

body.ir-auth .minimal-scroll-top {
    border-radius: 0;
    background: transparent;
    color: var(--ir-ink);
    border: 1px solid var(--ir-rule-hard);
    width: 42px;
    height: 42px;
}

body.ir-auth .minimal-scroll-top:hover {
    background: var(--ir-live);
    border-color: var(--ir-live);
    color: #05130b;
}

body.ir-auth .cookies-card {
    border-radius: 0;
    background: var(--ir-panel);
    border: 1px solid var(--ir-rule-hard);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

body.ir-auth .cookies-card__content,
body.ir-auth .cookies-card .text--base { color: var(--ir-dim); }
body.ir-auth .cookies-card .text--base { color: var(--ir-live); }

body.ir-auth .cookies-card__btn .btn--base,
body.ir-auth .cookies-card .btn--base {
    border-radius: 0;
    background: var(--ir-live);
    border-color: var(--ir-live);
    color: #05130b;
    font-family: var(--ir-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body.ir-auth .cookies-card__icon { background: transparent; color: var(--ir-live); }

/* --- page frame --------------------------------------------------------- */

.ir-auth__bar {
    border-bottom: 1px solid var(--ir-rule);
}

.ir-auth__bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
}

.ir-auth__brand {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 0.4rem 0;
}

.ir-auth__brand img { max-height: 28px; width: auto; }

.ir-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    font-family: var(--ir-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ir-dim);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}

.ir-auth__back:hover { color: var(--ir-ink); border-color: var(--ir-rule-hard); }

/* Centred on tall viewports, top-aligned once the form is taller than the
   screen. The document bar is the only fixed-height element in the flow. */
.ir-auth__wrap {
    padding: 2.5rem 0 4rem;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 58px);
}

.ir-auth__wrap > .container { width: 100%; }

.ir-auth__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 992px) {
    .ir-auth__wrap { padding: 3.5rem 0 5rem; }
    .ir-auth__grid {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
        gap: 3.5rem;
        align-items: stretch;
    }
}

/* --- the form sheet (drafting paper) ------------------------------------- */

.ir-auth__sheet {
    background: var(--ir-paper);
    color: var(--ir-paper-ink);
    border: 1px solid var(--ir-paper-rule);
    padding: 1.75rem 1.5rem 1.5rem;
}

@media (min-width: 576px) {
    .ir-auth__sheet { padding: 2.5rem 2.25rem 2rem; }
}

.ir-auth__ref {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--ir-paper-rule);
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ir-paper-dim);
}

.ir-auth__ref b { color: var(--ir-brand); font-weight: 500; }

.ir-auth__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 3.4vw, 2.1rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.028em;
    color: var(--ir-paper-ink);
}

.ir-auth__deck {
    margin: 0 0 1.75rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ir-paper-dim);
    max-width: 34rem;
}

/* --- error summary ------------------------------------------------------ */

.ir-auth__errors {
    margin: 0 0 1.5rem;
    border: 1px solid var(--ir-danger);
    border-left-width: 3px;
    background: rgba(161, 64, 47, 0.06);
    padding: 0.9rem 1rem;
}

.ir-auth__errors-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ir-danger);
}

.ir-auth__errors-mark {
    flex: none;
    width: 18px;
    height: 18px;
    border: 1px solid currentColor;
    display: grid;
    place-items: center;
    font-family: var(--ir-mono);
    font-size: 0.6875rem;
    margin-top: 0.15rem;
}

.ir-auth__errors-list {
    margin: 0;
    padding: 0 0 0 1.65rem;
    list-style: none;
    display: grid;
    gap: 0.3rem;
}

.ir-auth__errors-list li {
    position: relative;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ir-paper-ink);
}

.ir-auth__errors-list li::before {
    content: '\2014';
    position: absolute;
    left: -1.1rem;
    color: var(--ir-danger);
}

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

.ir-auth__form { margin: 0; }

.ir-auth__field { margin-bottom: 1.1rem; }

.ir-auth__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin-bottom: 1.1rem;
}

@media (min-width: 480px) {
    .ir-auth__row { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
    .ir-auth__row .ir-auth__field { margin-bottom: 0; }
}

.ir-auth__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.4rem;
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ir-paper-dim);
}

.ir-auth__label a {
    color: var(--ir-brand);
    text-decoration: none;
    letter-spacing: .1em;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

.ir-auth__label a:hover { text-decoration: underline; }

.ir-auth__input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 0.85rem;
    background: #fff;
    border: 1px solid var(--ir-paper-rule);
    border-radius: 0;
    color: var(--ir-paper-ink);
    font-family: var(--ir-mono);
    font-size: 0.9375rem;
    line-height: 1.4;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.ir-auth__input::placeholder { color: #9aa094; }

.ir-auth__input:hover { border-color: rgba(16, 20, 15, 0.34); }

.ir-auth__input:focus {
    border-color: var(--ir-brand);
    box-shadow: inset 0 0 0 1px var(--ir-brand);
    outline: none;
}

.ir-auth__input:focus-visible {
    outline: 2px solid var(--ir-brand);
    outline-offset: 1px;
}

.ir-auth__input[aria-invalid='true'] { border-color: var(--ir-danger); }
.ir-auth__input[aria-invalid='true']:focus { box-shadow: inset 0 0 0 1px var(--ir-danger); }

.ir-auth__input[readonly] {
    background: var(--ir-paper-2);
    color: var(--ir-paper-dim);
}

.ir-auth__input-wrap { position: relative; }

.ir-auth__input-wrap .ir-auth__input { padding-right: 3.25rem; }

.ir-auth__eye {
    position: absolute;
    right: 0;
    top: 0;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--ir-paper-rule-soft);
    color: var(--ir-paper-dim);
    cursor: pointer;
    transition: color .14s ease, background-color .14s ease;
}

.ir-auth__eye:hover { color: var(--ir-paper-ink); background: rgba(16, 20, 15, 0.04); }
.ir-auth__eye i { font-size: 1.05rem; line-height: 1; }

.ir-auth__err {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--ir-danger);
}

.ir-auth__err::before { content: '\2192'; flex: none; }

.ir-auth__hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--ir-paper-dim);
}

/* Password requirements. The list is injected by assets/global/js/
   secure_password.js (upper/lowercase/number/symbol/min-length) and is only
   rendered when gs('secure_password') is on, matching the server rule. */
.ir-auth__input-wrap .input-popup {
    display: block;
    position: static;
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--ir-paper-rule-soft);
    background: var(--ir-paper-2);
    list-style: none;
}

.ir-auth__input-wrap .input-popup p {
    position: relative;
    margin: 0 0 0.2rem;
    padding-left: 1.05rem;
    font-family: var(--ir-mono);
    font-size: 0.625rem;
    letter-spacing: 0.04em;
    line-height: 1.5;
    color: var(--ir-paper-dim);
}

.ir-auth__input-wrap .input-popup p:last-child { margin-bottom: 0; }

.ir-auth__input-wrap .input-popup p::before {
    content: '\25CB';
    position: absolute;
    left: 0;
    top: 0;
}

.ir-auth__input-wrap .input-popup p.error::before { content: '\25CB'; color: var(--ir-danger); }
.ir-auth__input-wrap .input-popup p.success::before { content: '\25CF'; color: var(--ir-brand); }
.ir-auth__input-wrap .input-popup p.success { color: var(--ir-paper-ink); }

/* --- checkbox ----------------------------------------------------------- */

.ir-auth__terms {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 1.25rem 0 0;
}

.ir-auth__check {
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0.05rem 0 0;
    border-radius: 0;
    border: 1px solid var(--ir-paper-rule);
    accent-color: var(--ir-brand);
    cursor: pointer;
}

.ir-auth__terms-label {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ir-paper-dim);
    cursor: pointer;
}

.ir-auth__terms-label a { color: var(--ir-brand); text-decoration: underline; }

/* --- primary action ----------------------------------------------------- */

.ir-auth__go {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 48px;
    margin-top: 1.5rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--ir-brand);
    border-radius: 0;
    background: var(--ir-brand);
    color: #fff;
    font-family: var(--ir-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.ir-auth__go:hover {
    background: #14603a;
    border-color: #14603a;
    color: #fff;
}

.ir-auth__go:focus-visible {
    outline: 2px solid var(--ir-paper-ink);
    outline-offset: 2px;
}

.ir-auth__go[disabled] { opacity: .6; cursor: not-allowed; }

/* --- alt action --------------------------------------------------------- */

.ir-auth__alt {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    margin: 1.5rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--ir-paper-rule-soft);
    font-size: 0.8125rem;
    color: var(--ir-paper-dim);
}

.ir-auth__alt a {
    color: var(--ir-brand);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(28, 122, 76, 0.4);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.ir-auth__alt a:hover { color: var(--ir-paper-ink); border-color: currentColor; }

.ir-auth__meta {
    margin: 1.5rem 0 0;
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8b9086;
}

/* --- social (only rendered when a provider is enabled) ------------------ */

.ir-auth__social {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1.5rem;
}

.ir-auth__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 46px;
    padding: 0.7rem 1rem;
    border: 1px solid var(--ir-paper-rule);
    background: #fff;
    color: var(--ir-paper-ink);
    font-size: 0.875rem;
    text-decoration: none;
    transition: border-color .14s ease, background-color .14s ease;
}

.ir-auth__social a:hover { border-color: var(--ir-paper-ink); background: var(--ir-paper-2); }

.ir-auth__sep {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.5rem;
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ir-paper-dim);
}

.ir-auth__sep::before,
.ir-auth__sep::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--ir-paper-rule-soft);
}

/* --- verification code --------------------------------------------------
   assets/global/css/verification-code.css draws this as one real input with a
   decorative .boxes overlay behind it. The input MUST stay transparent or it
   covers the overlay, so only geometry and colour are overridden here. */

.ir-auth__code { margin-bottom: 1.1rem; }
.ir-auth__code .mb-3 { margin-bottom: 0; }
.ir-auth__code .form-label { display: none; }

.ir-auth__code .verification-code {
    height: 54px;
    width: 100%;
}

.ir-auth__code .verification-code::after { display: none; }

.ir-auth__code .boxes {
    z-index: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.ir-auth__code .verification-code span {
    height: 54px;
    width: calc((100% / 6) - 5px);
    line-height: 52px;
    border: 1px solid var(--ir-paper-rule);
    background: #fff;
    color: transparent;
    font-size: 0;
    text-align: center;
}

.ir-auth__code .verification-code input {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 54px;
    padding: 0 0.6rem 0 0.9rem;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-family: var(--ir-mono);
    font-size: 1.3rem !important;
    font-weight: 500;
    letter-spacing: .5em;
    text-indent: .5em;
    color: var(--ir-paper-ink) !important;
}

.ir-auth__code .verification-code input:focus {
    background: transparent;
    box-shadow: none;
    outline: none;
}

/* Focus lands on the input, so the ring has to be drawn on the boxes. */
.ir-auth__code .verification-code:focus-within span {
    border-color: var(--ir-brand);
}

.ir-auth__code .form-control,
.ir-auth__code .minimal-input {
    border-radius: 0;
    font-family: var(--ir-mono);
}

/* --- context panel (graphite) ------------------------------------------- */

.ir-auth__side { min-width: 0; }

.ir-auth__side-inner {
    border: 1px solid var(--ir-rule);
    background: var(--ir-void-2);
    padding: 1.5rem 1.35rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ir-auth__side-k {
    margin: 0 0 0.6rem;
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ir-live);
}

.ir-auth__side-title {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.022em;
    color: var(--ir-ink);
}

/* Vertical settlement path — the same five stops as the landing hero,
   so the auth pages and the homepage read as one document. */
.ir-auth__path {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.ir-auth__path li { position: relative; padding: 0 0 1rem 1.4rem; }

.ir-auth__path li:last-child { padding-bottom: 0; }

.ir-auth__path li::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--ir-rule);
}

.ir-auth__path li:last-child::before { bottom: auto; height: 8px; }

.ir-auth__path li::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 7px;
    height: 7px;
    border: 1px solid var(--ir-live);
    background: var(--ir-void-2);
    transform: rotate(45deg);
}

.ir-auth__path li:last-child::after { background: var(--ir-live); }

.ir-auth__path-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.1rem;
}

.ir-auth__path-code {
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.16em;
    color: var(--ir-live);
    flex: none;
}

.ir-auth__path-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ir-ink);
}

.ir-auth__path-note {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ir-dim);
}

/* The KYC scope note. Grounded in the `kyc` middleware group in
   routes/user.php: advertising, deposits and withdrawals only. */
.ir-auth__scope {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--ir-rule);
    border-left: 2px solid var(--ir-live);
    background: rgba(52, 210, 126, 0.04);
}

.ir-auth__scope-k {
    display: block;
    margin: 0 0 0.5rem;
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ir-live);
}

.ir-auth__scope-text {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--ir-dim);
}

.ir-auth__scope-text b { color: var(--ir-ink); font-weight: 500; }

.ir-auth__scope-text--sub {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--ir-rule-soft);
    color: var(--ir-dimmer);
}

/* Pinned to the bottom so the panel keeps a stable baseline however tall the
   form sheet beside it is. */
.ir-auth__side-foot {
    margin: auto 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ir-rule-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    font-family: var(--ir-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ir-dimmer);
}

.ir-auth__side-foot a { color: var(--ir-dim); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.ir-auth__side-foot a:hover { color: var(--ir-live); }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 991.98px) {
    .ir-auth__side-inner { padding: 1.25rem 1.1rem; }
    .ir-auth__side-title { font-size: 1.125rem; }
}

/* Comfortable touch targets for the links that sit on their own line. */
@media (max-width: 991.98px) {
    .ir-auth__alt a,
    .ir-auth__side-foot a { min-height: 44px; }
    .ir-auth__alt { gap: 0 0.5rem; }
}

@media (max-width: 575.98px) {
    body.ir-auth .container { padding-left: 1rem; padding-right: 1rem; }
    .ir-auth__wrap { padding: 1.5rem 0 3rem; min-height: 0; }
    .ir-auth__grid { gap: 1.5rem; }
    .ir-auth__sheet { padding: 1.5rem 1.15rem 1.25rem; }
    /* Tighten the bar rather than hiding the label — the arrow alone is
       ambiguous on its own. */
    .ir-auth__back { font-size: 0.625rem; letter-spacing: 0.08em; gap: 0.35rem; }
    .ir-auth__code .verification-code input { letter-spacing: .4em; text-indent: .4em; }
    .ir-auth__code .verification-code span { height: 52px; line-height: 50px; }
    .ir-auth__code .verification-code { height: 52px; }
}

@media (max-width: 359.98px) {
    .ir-auth__back-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body.ir-auth * { transition-duration: 0.01ms !important; }
}
