/* Login / register / OTP / forgot-password pages, new design (App\Support\AuthUi). Loaded after app.css. */
body.a2 {
    --ink: #0d1b21;
    --deep: #09151a;
    --surface: #132a33;
    --line: #24414c;
    --text: #eaf2f0;
    --muted: #8fa6ab;
    --gold: #f0a92e;
    --gold-hi: #f6bd55;
    --link: #f0a92e;
    --brand-bg: #09151a;
    --on-gold: #1c1404;
    --up: #3cc17e;
    --down: #e4574f;
    --err: #ff7b72;
    background: var(--ink);
    color: var(--text);
    font: 15px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.a2::before { content: none; }
body.a2 .mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; letter-spacing: 0; }
body.a2 .muted { color: var(--muted); }
body.a2 a { color: inherit; }

/* Shell: brand panel + form */
.a2-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.a2-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-start;
    padding: 48px 56px; background: var(--brand-bg); border-right: 1px solid var(--line);
}
.a2-brand__mark { position: relative; z-index: 1; display: inline-flex; align-self: flex-start; }
.a2-brand__mark img { display: block; max-height: 76px; max-width: 280px; object-fit: contain; }
.a2-brand__mark span { font-weight: 700; font-size: clamp(34px, 4vw, 54px); line-height: 1.05; letter-spacing: -0.025em; }
.a2-brand__line { position: relative; z-index: 1; max-width: 30ch; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.a2-chart { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 58%; }
.a2-candle line { stroke-width: 1.4; }
.a2-candle.is-up line { stroke: var(--up); }
.a2-candle.is-up rect { fill: var(--up); }
.a2-candle.is-down line { stroke: var(--down); }
.a2-candle.is-down rect { fill: var(--down); }
.a2-candle { opacity: .9; transform-box: fill-box; transform-origin: 50% 100%; animation: a2-rise .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes a2-rise { from { opacity: 0; transform: scaleY(.15); } }
@media (prefers-reduced-motion: reduce) { .a2-candle { animation: none; } }

.a2-main { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.a2-form { width: 100%; max-width: 384px; }

/* Page content */
body.a2 h1 { margin: 0 0 6px; font: 600 28px/1.2 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: -0.02em; }
body.a2 h1 + .muted, body.a2 h1 + p { margin-top: 0 !important; }
body.a2 p.lead { margin: 14px 0 22px; color: var(--muted); }
body.a2 .a2-form > form, body.a2 .a2-form > #pk-box { margin-top: 26px; }
body.a2 .field { margin-bottom: 16px; }
body.a2 label { display: block; margin-bottom: 6px; color: var(--text); font-size: 13.5px; font-weight: 500; }
body.a2 .input, body.a2 .select {
    height: 48px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--deep); color: var(--text);
    font: 500 15px "IBM Plex Sans", system-ui, sans-serif; box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
body.a2 .input.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }
body.a2 .input::placeholder { color: #5f777d; }
body.a2 .input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 169, 46, .22); }
body.a2 .input[readonly] { opacity: .6; }
body.a2 .error { margin: 6px 0 0; color: var(--err); font-size: 13px; }

body.a2 .btn {
    height: 50px; padding: 0 20px; border-radius: 10px; border: 0;
    background: var(--gold); color: var(--on-gold); box-shadow: none;
    font: 600 15px "IBM Plex Sans", system-ui, sans-serif; transition: background .15s;
}
body.a2 .btn:hover { background: var(--gold-hi); transform: none; box-shadow: none; }
body.a2 .btn:focus-visible, body.a2 .pk-btn:focus-visible, body.a2 a:focus-visible, body.a2 button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
body.a2 .btn:disabled { opacity: .5; cursor: not-allowed; }
body.a2 .btn--ghost, body.a2 .pk-btn { background: transparent; color: var(--text); border: 1px solid var(--line); }
body.a2 .btn--ghost:hover, body.a2 .pk-btn:hover { background: var(--surface); border-color: #355a67; }
body.a2 .pk-btn svg { width: 20px; height: 20px; color: var(--gold); }

body.a2 .row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 20px; font-size: 14px; color: var(--muted); }
body.a2 .row label { color: var(--muted); font-weight: 400; font-size: 14px; }
body.a2 input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); }
body.a2 .forgot-link, body.a2 .alt a, body.a2 .linkish, body.a2 .reg-agree a, body.a2 .reg-terms summary { color: var(--link); font-weight: 500; }
body.a2 .forgot-link:hover, body.a2 .alt a:hover { text-decoration: underline; }
body.a2 .alt { margin: 22px 0 0; color: var(--muted); font-size: 14px; }

body.a2 .pk-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
body.a2 .pk-or span { flex: 1; height: 1px; background: var(--line); }
body.a2 #pk-msg { margin: 8px 0 0; text-align: left; }
body.a2 #pk-msg:empty { display: none; }
body.a2 .login-dl { margin: 14px 0 0; padding: 8px 0; color: var(--muted); opacity: 1; justify-content: flex-start; }
body.a2 .login-dl:hover { color: var(--text); }

body.a2 .alert { border-radius: 10px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.a2 .alert--success { border-color: rgba(60, 193, 126, .45); background: rgba(60, 193, 126, .08); }
body.a2 .alert--error { border-color: rgba(228, 87, 79, .5); background: rgba(228, 87, 79, .08); }
body.a2 .alert--error b { color: var(--err); }

/* OTP steps (register, login OTP, reset password) */
body.a2 .otp-step { border-color: var(--line); border-radius: 10px; background: var(--surface); }
body.a2 .otp-step__code, body.a2 .otp-code { height: 56px; text-align: center; letter-spacing: .45em; font: 600 22px "IBM Plex Mono", ui-monospace, Menlo, monospace; }
body.a2 .linkish:disabled { color: var(--muted); }

/* Register: terms */
body.a2 .reg-terms { border-color: var(--line); border-radius: 10px; background: var(--deep); }
body.a2 .reg-terms__body { border-top-color: var(--line); }
body.a2 .reg-agree { color: var(--text) !important; }

/* Registered: Client ID */
body.a2 .login-id { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; background: none; border-color: var(--gold); color: var(--gold) !important; -webkit-text-fill-color: var(--gold) !important; }

/* Phones and small tablets: brand band on top, form below */
@media (max-width: 900px) {
    .a2-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .a2-brand { min-height: 168px; padding: 24px 20px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
    .a2-brand__mark img { max-height: 48px; max-width: 200px; }
    .a2-brand__mark span { font-size: 26px; }
    .a2-brand__line { margin-top: 8px; max-width: 26ch; font-size: 14px; }
    .a2-chart { left: 30%; height: 100%; opacity: .55; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%); mask-image: linear-gradient(90deg, transparent, #000 35%); }
    .a2-main { align-items: flex-start; padding: 28px 20px 40px; }
    body.a2 h1 { font-size: 24px; }
}
@media (max-width: 900px) { .a2-brand { min-height: 188px; } .a2-chart { left: auto; right: 0; width: 72%; height: 50%; } }

/* Light version (App\Support\AuthUi::LIGHT): same layout, light colours. */
body.a2.a2--light {
    --ink: #f6f8f7;
    --deep: #ffffff;
    --surface: #eef2f0;
    --line: #d3dcd8;
    --text: #13232a;
    --muted: #5a6c71;
    --gold: #f0a92e;
    --gold-hi: #e59a17;
    --on-gold: #1c1404;
    --link: #9a5d05;
    --brand-bg: #e9efec;
    --up: #1f9a5b;
    --down: #cf3f37;
    --err: #c0352d;
    color-scheme: light;
}
body.a2--light .input::placeholder { color: #8b9b9f; }
body.a2--light .input:focus { box-shadow: 0 0 0 3px rgba(240, 169, 46, .28); }
body.a2--light .btn--ghost:hover, body.a2--light .pk-btn:hover { border-color: #b9c6c1; }
body.a2--light .a2-candle { opacity: 1; }
body.a2--light .login-id { color: var(--link) !important; -webkit-text-fill-color: var(--link) !important; border-color: var(--gold); }
