@import url("/assets/fonts/manrope/manrope.css");

:root {
    --auth-font: "Manrope", "Segoe UI", Arial, sans-serif;
    --auth-bg-1: #050b15;
    --auth-bg-2: #08111f;
    --auth-bg-3: #0b1b32;
    --auth-card: rgba(14, 27, 48, .84);
    --auth-card-2: rgba(15, 23, 42, .42);
    --auth-border: rgba(148, 163, 184, .16);
    --auth-border-strong: rgba(56, 189, 248, .36);
    --auth-text: #e7eefb;
    --auth-soft: #9babc1;
    --auth-muted: #64748b;
    --auth-blue: #2563eb;
    --auth-cyan: #38bdf8;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.crm-auth-body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: var(--auth-font);
    background:
        radial-gradient(circle at 12% 12%, rgba(37, 99, 235, .28), transparent 30rem),
        radial-gradient(circle at 88% 22%, rgba(6, 182, 212, .16), transparent 28rem),
        linear-gradient(135deg, var(--auth-bg-1), var(--auth-bg-2) 42%, var(--auth-bg-3));
    color: var(--auth-text);
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.crm-auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
}

.crm-auth-left {
    position: relative;
    min-height: 100vh;
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.crm-auth-left::before {
    content: "";
    position: absolute;
    inset: 26px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
    pointer-events: none;
}

.crm-auth-left::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -120px;
    bottom: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56,189,248,.18), transparent 68%);
    pointer-events: none;
}

.crm-auth-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    width: fit-content;
}

.crm-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(56, 189, 248, .95), rgba(37, 99, 235, .95));
    color: white;
    font-weight: 900;
    font-size: 20px;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .32);
}

.crm-auth-logo > span:last-child {
    display: grid;
    gap: 3px;
}

.crm-auth-logo strong {
    color: white;
    font-size: 18px;
    font-weight: 900;
}

.crm-auth-logo small {
    color: #93a4bd;
    font-size: 12px;
    font-weight: 750;
}

.crm-auth-hero {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.crm-kicker {
    display: inline-flex;
    color: var(--auth-cyan);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    margin-bottom: 12px;
}

.crm-auth-hero h1 {
    margin: 0;
    font-size: clamp(38px, 5vw, 68px);
    line-height: 1.02;
    letter-spacing: .03em;
    font-weight: 900;
}

.crm-auth-hero p {
    max-width: 620px;
    margin: 22px 0 0;
    color: #a8b7cc;
    font-size: 17px;
    line-height: 1.55;
}

.crm-auth-benefits {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 680px;
}

.crm-auth-benefits div {
    min-height: 92px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 22px;
    background: rgba(15, 23, 42, .36);
    backdrop-filter: blur(18px);
    padding: 16px;
    display: grid;
    align-content: center;
    gap: 5px;
}

.crm-auth-benefits b {
    color: var(--auth-cyan);
    font-size: 24px;
    line-height: 1;
}

.crm-auth-benefits span {
    color: #98a9c1;
    font-size: 13px;
    font-weight: 750;
}

.crm-auth-right {
    min-height: 100vh;
    padding: 34px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
}

.crm-auth-card {
    width: min(460px, 100%);
    border: 1px solid var(--auth-border);
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .10), transparent 18rem),
        var(--auth-card);
    box-shadow: 0 30px 90px rgba(0,0,0,.36);
    backdrop-filter: blur(24px);
    padding: 28px;
}

.crm-auth-card-head {
    margin-bottom: 22px;
}

.crm-auth-badge {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: #93c5fd;
    background: rgba(59, 130, 246, .14);
    border: 1px solid rgba(59, 130, 246, .22);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 14px;
}

.crm-auth-card h2 {
    margin: 0;
    color: white;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.03em;
}

.crm-auth-card p {
    margin: 10px 0 0;
    color: var(--auth-soft);
    line-height: 1.45;
}

.crm-auth-form {
    display: grid;
    gap: 16px;
}

.crm-auth-step {
    display: none;
    gap: 16px;
}

.crm-auth-step.active {
    display: grid;
}

.crm-auth-field {
    display: grid;
    gap: 8px;
}

.crm-auth-field > span {
    color: #9fb0c8;
    font-size: 13px;
    font-weight: 850;
}

.crm-auth-field > div:not(.crm-auth-real-otp) {
    min-height: 52px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 18px;
    background: var(--auth-card-2);
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    transition: .16s ease;
}

.crm-auth-field > div:not(.crm-auth-real-otp):focus-within {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .15);
    background: rgba(15, 23, 42, .62);
}

.crm-auth-field svg {
    width: 20px;
    height: 20px;
    fill: var(--auth-cyan);
}

.crm-auth-field input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--auth-text);
    font-weight: 750;
}

#authPhone {
    letter-spacing: .02em;
}

.crm-auth-real-otp {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.crm-auth-real-otp input {
    width: 100%;
    height: 68px;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(15,23,42,.62), rgba(15,23,42,.42));
    color: #ffffff;
    text-align: center;
    font-size: 30px;
    line-height: 1;
    font-weight: 950;
    outline: none;
    padding: 0;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.06),
        0 10px 24px rgba(0,0,0,.18);
    caret-color: var(--auth-cyan);
    transition: .16s ease;
}

.crm-auth-real-otp input:focus {
    border-color: var(--auth-cyan);
    box-shadow:
        0 0 0 4px rgba(56,189,248,.16),
        0 14px 30px rgba(37,99,235,.22),
        inset 0 1px 0 rgba(255,255,255,.08);
    transform: translateY(-1px);
}

.crm-auth-real-otp input.filled {
    border-color: rgba(56,189,248,.36);
    background:
        radial-gradient(circle at top left, rgba(56,189,248,.22), transparent 120%),
        rgba(15,23,42,.62);
}

.crm-auth-code-info {
    margin-top: 2px;
    border: 1px dashed rgba(148,163,184,.18);
    border-radius: 16px;
    background: rgba(15,23,42,.20);
    padding: 12px 14px;
    display: grid;
    gap: 4px;
}

.crm-auth-code-info span {
    color: #8fa0b9;
    font-size: 12px;
    font-weight: 750;
}

.crm-auth-code-info strong {
    color: #93c5fd;
    font-size: 14px;
}

.crm-auth-submit {
    min-height: 52px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: white;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 16px 36px rgba(37, 99, 235, .28);
    transition: .16s ease;
}

.crm-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(37, 99, 235, .34);
}

.crm-auth-submit svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.crm-auth-back {
    min-height: 42px;
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 16px;
    background: rgba(15,23,42,.32);
    color: var(--auth-cyan);
    font-weight: 900;
}

.crm-auth-note {
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 18px;
    background: rgba(15, 23, 42, .32);
    padding: 13px;
    display: grid;
    gap: 4px;
}

.crm-auth-note strong {
    color: white;
    font-size: 13px;
}

.crm-auth-note span {
    color: #8fa0b9;
    font-size: 12px;
    line-height: 1.35;
}

.crm-auth-footer {
    width: min(460px, 100%);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 750;
}

@media (max-width: 980px) {
    .crm-auth-page {
        min-height: 100vh;
        grid-template-columns: 1fr;
        place-items: center;
        padding: 16px;
    }

    .crm-auth-left {
        display: none;
    }

    .crm-auth-right {
        width: 100%;
        min-height: auto;
        padding: 0;
    }

    .crm-auth-card,
    .crm-auth-footer {
        width: min(460px, 100%);
    }
}

@media (max-width: 520px) {
    .crm-auth-page {
        padding: 0;
        place-items: stretch;
        align-items: center;
    }

    .crm-auth-right {
        padding: 14px;
    }

    .crm-auth-card {
        width: 100%;
        border-radius: 24px;
        padding: 20px;
    }

    .crm-auth-card h2 {
        font-size: 30px;
    }

    .crm-auth-footer {
        display: none;
    }

    .crm-auth-real-otp {
        gap: 9px;
    }

    .crm-auth-real-otp input {
        height: 62px;
        border-radius: 18px;
        font-size: 27px;
    }
}


/* ==========================
   AUTH ALERTS
   ========================== */

   .crm-auth-message {
    display: none;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.crm-auth-message.show {
    display: block;
}

.crm-auth-message.error {
    color: #fecaca;
    background: rgba(127, 29, 29, .25);
    border: 1px solid rgba(248, 113, 113, .25);
}

.crm-auth-message.success {
    color: #bbf7d0;
    background: rgba(20, 83, 45, .25);
    border: 1px solid rgba(34, 197, 94, .25);
}

.crm-auth-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.crm-auth-submit:disabled:hover {
    transform: none;
}

/* Красивый placeholder */

.crm-auth-field input::placeholder {
    color: rgba(155, 171, 193, .6);
}

/* Небольшой shake для ошибок */

.crm-auth-message.error.show {
    animation: authShake .25s linear;
}

@keyframes authShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}
