/* ==========================================================================
   Kantrix Auth — Login, Signup & Reset Password Stylesheet
   Strict CSP safe (no inline styles/scripts).
   ========================================================================== */

:root {
    --auth-purple: #7c3aed;
    --auth-purple-600: #6d28d9;
    --auth-purple-700: #5b21b6;
    --auth-purple-900: #2e1065;
    --auth-purple-100: #f1e9ff;
    --auth-purple-050: #faf7ff;
    --auth-ink: #17102b;
    --auth-muted: #5d5577;
    --auth-line: #ebe3fa;
    --auth-surface: #ffffff;
    --auth-bg: #f8f6fc;
    --auth-green: #059669;
    --auth-green-bg: #ecfdf5;
    --auth-green-border: #a7f3d0;
    --auth-red: #b91c1c;
    --auth-red-bg: #fef2f2;
    --auth-red-border: #fecaca;
    --auth-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --auth-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

body.auth-body {
    margin: 0;
    font-family: var(--auth-font);
    color: var(--auth-ink);
    background: var(--auth-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid rgba(124, 58, 237, 0.55);
    outline-offset: 2px;
    border-radius: 6px;
}

.ico {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(380px, 0.92fr) minmax(0, 1.08fr);
    min-height: 100vh;
}

/* ---------- Promo Side ---------- */
.auth-promo {
    position: relative;
    padding: 36px 40px;
    background: linear-gradient(155deg, #2e1065 0%, #4c1d95 52%, #6d28d9 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
}

.auth-promo::before {
    content: "";
    position: absolute;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.28) 0%, transparent 70%);
    top: -120px;
    right: -120px;
    pointer-events: none;
}

.auth-promo-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-brand-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.55);
}

.auth-brand-img {
    height: 40px;
    width: auto;
    max-width: 210px;
    object-fit: contain;
    display: block;
}

.auth-brand-img--sm {
    height: 40px;
}

.auth-back-link {
    font-size: 0.84rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.auth-back-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.auth-promo-body {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.auth-promo-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-promo-title {
    margin: -10px 0 0;
    font-size: clamp(1.25rem, 2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.auth-promo-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -28px;
    background: transparent;
}

.auth-promo-img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 480px;
    height: auto;
    object-fit: contain;
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.auth-promo-sub {
    margin: 0;
    font-size: 0.96rem;
    color: rgba(255, 255, 255, 0.85);
}

.auth-url-showcase {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(17, 9, 43, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-url-showcase small {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.75);
}

.auth-url-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-url-chip {
    font-family: var(--auth-mono);
    font-size: 0.77rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.auth-feature-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92);
}

.auth-feature-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.auth-promo-foot {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.74);
}

/* ---------- Form Side ---------- */
.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 24px;
    background: var(--auth-surface);
}

.auth-mobile-head {
    display: none;
    width: 100%;
    max-width: 470px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.auth-card {
    width: 100%;
    max-width: 470px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-card--wide {
    max-width: 520px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--auth-purple-100);
    color: var(--auth-purple-700);
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-head h1 {
    margin: 8px 0 4px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-head p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--auth-muted);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 600;
}

.auth-alert--ok {
    background: var(--auth-green-bg);
    color: var(--auth-green);
    border: 1px solid var(--auth-green-border);
}

.auth-alert--err {
    background: var(--auth-red-bg);
    color: var(--auth-red);
    border: 1px solid var(--auth-red-border);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.auth-field label {
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--auth-ink);
}

.auth-link {
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--auth-purple-700);
}

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

.auth-input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid #dbd1f4;
    background: #fff;
    font-size: 0.93rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.auth-pass-wrap {
    position: relative;
}

.auth-pass-wrap .auth-input {
    padding-right: 68px;
}

.auth-pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--auth-line);
    background: var(--auth-purple-050);
    color: var(--auth-purple-700);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 7px;
    cursor: pointer;
}

.auth-prefix-box {
    display: flex;
    align-items: center;
    border: 1px solid #dbd1f4;
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
}

.auth-prefix-box:focus-within {
    border-color: var(--auth-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.auth-prefix {
    padding: 11px 10px 11px 12px;
    background: var(--auth-purple-050);
    border-right: 1px solid var(--auth-line);
    font-family: var(--auth-mono);
    font-size: 0.8rem;
    color: var(--auth-purple-700);
    white-space: nowrap;
}

.auth-prefix-box .auth-input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.auth-hint {
    font-size: 0.77rem;
    color: var(--auth-muted);
}

/* Free Tool Selector (1 Free Tool Rule) */
.auth-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.auth-tool-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 11px;
    border: 1px solid var(--auth-line);
    background: #fff;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 650;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.auth-tool-opt input {
    accent-color: var(--auth-purple-600);
    margin: 0;
}

.auth-tool-opt.is-selected {
    background: var(--auth-purple-050);
    border-color: var(--auth-purple);
    color: var(--auth-purple-900);
}

.auth-check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--auth-muted);
}

.auth-check-inline input {
    accent-color: var(--auth-purple-600);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #8b5cf6, var(--auth-purple-600));
    color: #fff;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px -14px rgba(109, 40, 217, 0.85);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.auth-btn-outline {
    background: #fff;
    color: var(--auth-purple-700);
    border-color: #d9caf8;
    box-shadow: none;
}

.auth-btn-outline:hover {
    background: var(--auth-purple-050);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--auth-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

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

.auth-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.auth-step-pill {
    text-align: center;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--auth-purple-050);
    color: var(--auth-muted);
    border: 1px solid var(--auth-line);
}

.auth-step-pill.is-active {
    background: var(--auth-purple-700);
    color: #fff;
    border-color: var(--auth-purple-700);
}

.auth-hero-media {
    margin-bottom: 16px;
    text-align: center;
    background: transparent;
}

.auth-hero-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    margin: 0 auto;
}

.auth-hero-media--forget {
    overflow: hidden;
    margin: -42px 0 4px;
    padding: 0 0 18px;
}

.auth-hero-img--forget {
    max-height: 360px;
    transform: scale(1.18);
    transform-origin: center center;
}

.auth-inline-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.auth-inline-group .auth-input {
    flex: 1 1 auto;
    min-width: 0;
}

.auth-inline-group--phone .auth-code-select {
    flex: 0 0 135px;
    width: 135px;
}

.auth-btn-sm {
    flex: 0 0 auto;
    width: auto;
    padding: 0 16px;
    min-height: 44px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.auth-field-status {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 4px;
}

.auth-field-status.is-ok {
    color: #15803d;
}

.auth-field-status.is-err {
    color: #b91c1c;
}

[hidden],
.auth-step-pane[hidden],
.auth-form[hidden],
.auth-alert[hidden],
.auth-field[hidden] {
    display: none !important;
}

@media (max-width: 960px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-promo {
        display: none;
    }

    .auth-mobile-head {
        display: flex;
    }
}

@media (max-width: 540px) {
    .auth-row-2,
    .auth-tool-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-main {
        padding: 22px 16px;
    }
}
