:root {
    --auth-panel: #fffaf5;
    --auth-surface: #ffffff;
    --auth-border: rgba(15, 23, 42, .12);
    --auth-muted: #64748b;
    --auth-text: #172033;
    --auth-orange: #f97316;
    --auth-orange-strong: #ea580c;
    --auth-indigo: #4f46e5;
    --auth-shadow: 0 30px 80px rgba(15, 23, 42, .12);
}

html[data-bs-theme="dark"],
html[data-user-theme="dark"] {
    --auth-panel: #111827;
    --auth-surface: #161f2e;
    --auth-border: rgba(255, 255, 255, .12);
    --auth-muted: #94a3b8;
    --auth-text: #f8fafc;
    --auth-shadow: 0 30px 80px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }

.ipseek-auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-surface);
    color: var(--auth-text);
}

.ipseek-auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 44%) 1fr;
}

.ipseek-auth-brand {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 4.5rem);
    color: #fff;
    background:
        radial-gradient(circle at 18% 16%, rgba(249, 115, 22, .38), transparent 28%),
        linear-gradient(145deg, #111827 0%, #202a44 48%, #312e81 100%);
}

.ipseek-auth-brand::after {
    content: "";
    position: absolute;
    inset: auto -15% -24% 22%;
    height: 48%;
    background: radial-gradient(circle, rgba(249, 115, 22, .28), transparent 64%);
    filter: blur(12px);
}

.ipseek-auth-brand-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 560px;
    display: flex;
    flex-direction: column;
}

.ipseek-auth-brand-logo,
.ipseek-auth-wordmark {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    font-weight: 800;
    letter-spacing: -.035em;
    text-decoration: none;
}

.ipseek-auth-brand-logo {
    color: #fff;
    font-size: 1.55rem;
}

.ipseek-auth-brand-logo:hover { color: #fff; }

.ipseek-auth-brand-logo-mark,
.ipseek-auth-wordmark-mark { color: var(--auth-orange); }

.ipseek-auth-brand-copy {
    margin-top: auto;
    margin-bottom: 4.5rem;
    max-width: 35rem;
}

.ipseek-auth-eyebrow {
    display: inline-flex;
    padding: .42rem .72rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    color: #fed7aa;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .06);
}

.ipseek-auth-brand-copy h2 {
    margin: 1.3rem 0 1rem;
    max-width: 11ch;
    color: #fff;
    font-size: clamp(2.5rem, 4.4vw, 4.9rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.ipseek-auth-brand-copy p {
    margin: 0;
    max-width: 34rem;
    color: #cbd5e1;
    font-size: 1.03rem;
    line-height: 1.7;
}

.ipseek-auth-brand-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    color: #cbd5e1;
    font-size: .84rem;
}

.ipseek-auth-brand-footer span {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
}

.ipseek-auth-network {
    position: absolute;
    inset: 9% 4% auto auto;
    width: min(33vw, 420px);
    aspect-ratio: 1;
    opacity: .8;
}

.ipseek-auth-network .node {
    position: absolute;
    width: 13px;
    height: 13px;
    border: 3px solid rgba(255, 255, 255, .78);
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(249, 115, 22, .08);
}

.ipseek-auth-network .node-a { top: 10%; left: 28%; }
.ipseek-auth-network .node-b { top: 35%; left: 62%; }
.ipseek-auth-network .node-c { top: 68%; left: 25%; }
.ipseek-auth-network .node-d { top: 78%; left: 76%; }
.ipseek-auth-network .node-e { top: 48%; left: 10%; }

.ipseek-auth-network .line {
    position: absolute;
    height: 2px;
    transform-origin: left center;
    background: linear-gradient(90deg, rgba(249, 115, 22, .72), rgba(255, 255, 255, .2));
}

.ipseek-auth-network .line-a { width: 40%; top: 18%; left: 31%; transform: rotate(33deg); }
.ipseek-auth-network .line-b { width: 48%; top: 40%; left: 14%; transform: rotate(-4deg); }
.ipseek-auth-network .line-c { width: 52%; top: 67%; left: 29%; transform: rotate(10deg); }
.ipseek-auth-network .line-d { width: 38%; top: 54%; left: 59%; transform: rotate(70deg); }

.ipseek-auth-form-side {
    display: flex;
    min-width: 0;
    flex-direction: column;
    background: var(--auth-panel);
}

.ipseek-auth-toolbar {
    min-height: 82px;
    padding: 1.25rem clamp(1.25rem, 4vw, 3.2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ipseek-auth-wordmark {
    color: var(--auth-text);
    font-size: 1.3rem;
}

.ipseek-auth-toolbar-actions {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.ipseek-auth-form-wrap {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem clamp(1.25rem, 5vw, 4.5rem) 4rem;
}

.ipseek-auth-form-card {
    width: min(100%, 520px);
    padding: clamp(1.6rem, 3vw, 2.6rem);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
}

.ipseek-auth-heading { margin-bottom: 1.7rem; }

.ipseek-auth-heading h1 {
    margin: 0 0 .65rem;
    color: var(--auth-text);
    font-size: clamp(1.9rem, 3vw, 2.55rem);
    letter-spacing: -.04em;
}

.ipseek-auth-heading p {
    margin: 0;
    color: var(--auth-muted);
    line-height: 1.6;
}

.ipseek-auth-form {
    display: grid;
    gap: 1rem;
}

.ipseek-auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ipseek-auth-field {
    display: grid;
    gap: .45rem;
}

.ipseek-auth-field label {
    color: var(--auth-text);
    font-size: .9rem;
    font-weight: 700;
}

.ipseek-auth-field input {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: .75rem .9rem;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ipseek-auth-field input:focus {
    border-color: rgba(249, 115, 22, .8);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .13);
}

.ipseek-password-control { position: relative; }
.ipseek-password-control input { padding-right: 3.2rem; }

.ipseek-password-toggle {
    position: absolute;
    top: 50%;
    right: .6rem;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
}

.ipseek-password-toggle:hover,
.ipseek-password-toggle:focus-visible {
    color: var(--auth-orange-strong);
    background: rgba(249, 115, 22, .1);
    outline: none;
}

.ipseek-auth-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: .9rem;
}

.ipseek-auth-form a,
.ipseek-auth-switch-copy a {
    color: var(--auth-orange-strong);
    font-weight: 700;
    text-decoration: none;
}

.ipseek-auth-form a:hover,
.ipseek-auth-switch-copy a:hover {
    text-decoration: underline;
}

.ipseek-auth-check {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--auth-muted);
    cursor: pointer;
}

.ipseek-auth-check input { accent-color: var(--auth-orange); }

.ipseek-auth-check--consent {
    align-items: flex-start;
    line-height: 1.45;
}

.ipseek-auth-submit {
    min-height: 50px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .65rem;
    border: 0;
    border-radius: 12px;
    padding: .75rem 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-orange), var(--auth-orange-strong));
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(249, 115, 22, .22);
    transition: transform .15s ease, opacity .15s ease;
}

.ipseek-auth-submit:hover { transform: translateY(-1px); }

.ipseek-auth-submit:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.ipseek-auth-submit--secondary {
    width: 100%;
    color: var(--auth-text);
    background: var(--auth-panel);
    box-shadow: none;
    border: 1px solid var(--auth-border);
}

.ipseek-auth-submit .fa-spinner { animation: ipseek-spin .8s linear infinite; }

@keyframes ipseek-spin {
    to { transform: rotate(360deg); }
}

.ipseek-auth-switch-copy {
    margin: .15rem 0 0;
    text-align: center;
    color: var(--auth-muted);
    font-size: .9rem;
}

.ipseek-auth-preview-note {
    margin: 1.5rem 0 0;
    padding-top: 1.15rem;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-muted);
    font-size: .78rem;
    line-height: 1.55;
}

.ipseek-auth-preview-note i {
    margin-right: .35rem;
    color: var(--auth-indigo);
}

.ipseek-auth-state {
    display: grid;
    gap: 1.2rem;
}

.ipseek-auth-state > p {
    color: var(--auth-muted);
    line-height: 1.65;
}

.ipseek-auth-state-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--auth-orange-strong);
    background: rgba(249, 115, 22, .11);
    font-size: 1.35rem;
}

.ipseek-auth-qr-placeholder {
    width: 176px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border: 1px dashed var(--auth-border);
    border-radius: 18px;
    background: var(--auth-panel);
    color: var(--auth-text);
    font-size: 5rem;
}

.ipseek-auth-steps {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--auth-muted);
    line-height: 1.7;
}

.ipseek-auth-code {
    letter-spacing: .32em;
    text-align: center;
    font-size: 1.25rem !important;
    font-family: "IBM Plex Mono", monospace !important;
}

@media (max-width: 920px) {
    .ipseek-auth-shell { grid-template-columns: 1fr; }
    .ipseek-auth-brand { padding: 1.35rem 1.4rem; min-height: auto; }
    .ipseek-auth-brand-inner { min-height: auto; }
    .ipseek-auth-brand-copy,
    .ipseek-auth-network,
    .ipseek-auth-brand-footer { display: none; }
    .ipseek-auth-form-side { min-height: calc(100vh - 76px); }
}

@media (max-width: 560px) {
    .ipseek-auth-toolbar { padding: 1rem 1.1rem; min-height: 70px; }
    .ipseek-auth-form-wrap { padding: 1rem .9rem 2rem; align-items: start; }
    .ipseek-auth-form-card { padding: 1.3rem 1.05rem; border-radius: 18px; }
    .ipseek-auth-grid-2 { grid-template-columns: 1fr; }
    .ipseek-auth-form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .65rem;
    }
}

/* Module 4.0 UAT corrective */
.ipseek-auth-toggle { display:inline-flex; align-items:center; gap:.7rem; color:var(--auth-muted); cursor:pointer; line-height:1.4; }
.ipseek-auth-toggle > input { position:absolute; opacity:0; pointer-events:none; }
.ipseek-auth-toggle__track { flex:0 0 auto; width:42px; height:24px; padding:3px; display:inline-flex; align-items:center; border:1px solid var(--auth-border); border-radius:999px; background:rgba(100,116,139,.22); transition:background .16s ease,border-color .16s ease,box-shadow .16s ease; }
.ipseek-auth-toggle__thumb { width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(15,23,42,.24); transform:translateX(0); transition:transform .16s ease; }
.ipseek-auth-toggle > input:checked + .ipseek-auth-toggle__track { border-color:rgba(249,115,22,.72); background:var(--auth-orange); }
.ipseek-auth-toggle > input:checked + .ipseek-auth-toggle__track .ipseek-auth-toggle__thumb { transform:translateX(18px); }
.ipseek-auth-toggle > input:focus-visible + .ipseek-auth-toggle__track { box-shadow:0 0 0 4px rgba(249,115,22,.16); }
.ipseek-auth-toggle__label { min-width:0; }


/* Module 4.0 UAT corrective:
   Keep the branded left panel positioned exactly like Login on every
   desktop auth page, regardless of the height of the form on the right. */
@media (min-width: 921px) {
    .ipseek-auth-brand {
        align-self: start;
        position: sticky;
        top: 0;
        height: 100vh;
        min-height: 100vh;
    }

    .ipseek-auth-brand-inner {
        height: 100%;
        min-height: 0;
    }
}

/* Module 4.2 registration */
.ipseek-auth-error { margin:.4rem 0 0; font-size:.82rem; line-height:1.35; color:#dc2626; }
.ipseek-auth-field-hint { margin:-.55rem 0 .15rem; font-size:.8rem; color:var(--auth-muted); }
.ipseek-auth-field input.is-invalid,
.ipseek-password-control input.is-invalid { border-color:#dc2626; }
.ipseek-auth-toggle-wrap { display:grid; gap:.15rem; }

/* Module 4.2 registration flash alerts */
.ipseek-alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: .9rem;
    line-height: 1.5;
}
.ipseek-alert__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-top: .08rem;
    font-size: 1rem;
}
.ipseek-alert__content {
    min-width: 0;
    flex: 1 1 auto;
}
.ipseek-alert--success {
    border-color: rgba(22, 163, 74, .28);
    background: rgba(22, 163, 74, .10);
    color: #166534;
}
[data-bs-theme="dark"] .ipseek-alert--success,
[data-user-theme="dark"] .ipseek-alert--success {
    border-color: rgba(74, 222, 128, .30);
    background: rgba(34, 197, 94, .12);
    color: #bbf7d0;
}

/* Module 4.3 verification alerts */
.ipseek-alert--error {
    border-color: rgba(220, 38, 38, .28);
    background: rgba(220, 38, 38, .10);
    color: #991b1b;
}
.ipseek-alert--warning {
    border-color: rgba(217, 119, 6, .30);
    background: rgba(245, 158, 11, .12);
    color: #92400e;
}
[data-bs-theme="dark"] .ipseek-alert--error,
[data-user-theme="dark"] .ipseek-alert--error {
    border-color: rgba(248, 113, 113, .30);
    background: rgba(239, 68, 68, .12);
    color: #fecaca;
}
[data-bs-theme="dark"] .ipseek-alert--warning,
[data-user-theme="dark"] .ipseek-alert--warning {
    border-color: rgba(251, 191, 36, .30);
    background: rgba(245, 158, 11, .12);
    color: #fde68a;
}
.ipseek-auth-form--compact {
    margin-top: .75rem;
}
