:root {
    --ft-auth-purple: #4f35c6;
    --ft-auth-purple-dark: #2b195f;
    --ft-auth-purple-deep: #17113f;
    --ft-auth-purple-soft: #f1edff;
    --ft-auth-indigo: #25215b;
    --ft-auth-teal: #13a085;
    --ft-auth-ink: #151735;
    --ft-auth-muted: #646781;
    --ft-auth-border: #dfe2f1;
    --ft-auth-surface: #ffffff;
    --ft-auth-surface-soft: #f8f7fc;
    --ft-auth-danger: #b42318;
    --ft-auth-danger-soft: #fff4f2;
    --ft-auth-success: #067647;
    --ft-auth-success-soft: #eefbf5;
    --ft-auth-focus: rgba(79, 53, 198, .18);
}

* {
    box-sizing: border-box;
}

.ft-auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--ft-auth-ink);
    background:
        linear-gradient(135deg, #fbfbff 0%, #f4f1ff 46%, #eef4ff 100%);
    font-family: Inter, Arial, Tahoma, sans-serif;
}

.ft-auth-page a {
    color: var(--ft-auth-purple);
}

.ft-auth-shell {
    width: min(1240px, calc(100% - 40px));
    min-height: calc(100vh - 64px);
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    align-items: center;
}

.ft-auth-login {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(360px, .86fr);
    min-height: min(720px, calc(100vh - 96px));
    background: var(--ft-auth-surface);
    border: 1px solid rgba(79, 53, 198, .12);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(28, 23, 69, .14);
    overflow: hidden;
}

.ft-auth-visual {
    position: relative;
    min-width: 0;
    padding: clamp(28px, 5vw, 56px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(145deg, rgba(79, 53, 198, .95), rgba(23, 17, 63, .98)),
        var(--ft-auth-purple);
    color: #ffffff;
}

.ft-auth-lang {
    display: flex;
    justify-content: flex-end;
}

.ft-auth-lang select {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    background: rgba(255, 255, 255, .12);
}

.ft-auth-lang option {
    color: var(--ft-auth-ink);
}

.ft-auth-brand {
    display: grid;
    gap: 26px;
    max-width: 560px;
}

.ft-auth-logo-main {
    width: min(430px, 100%);
    max-height: 240px;
    object-fit: contain;
    object-position: inline-start center;
    display: block;
    padding: 14px;
    background: rgba(255, 255, 255, .96);
    border-radius: 8px;
}

.ft-auth-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 8px;
    color: rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .1);
    font-size: 13px;
    font-weight: 700;
}

.ft-auth-brand h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.12;
    letter-spacing: 0;
}

.ft-auth-brand p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 17px;
    line-height: 1.7;
}

.ft-auth-panel {
    min-width: 0;
    padding: clamp(32px, 5vw, 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--ft-auth-surface);
}

.ft-auth-panel-header {
    margin-bottom: 28px;
}

.ft-auth-panel-header h2 {
    margin: 0 0 8px;
    color: var(--ft-auth-indigo);
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.25;
    letter-spacing: 0;
}

.ft-auth-panel-header p {
    margin: 0;
    color: var(--ft-auth-muted);
    line-height: 1.6;
}

.ft-auth-form {
    display: grid;
    gap: 18px;
}

.ft-auth-field {
    display: grid;
    gap: 7px;
}

.ft-auth-field label {
    color: var(--ft-auth-indigo);
    font-size: 14px;
    font-weight: 800;
}

.ft-auth-field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--ft-auth-border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--ft-auth-ink);
    background: var(--ft-auth-surface);
    font-size: 15px;
    outline: 0;
}

.ft-auth-field input:focus {
    border-color: var(--ft-auth-purple);
    box-shadow: 0 0 0 3px var(--ft-auth-focus);
}

.ft-auth-field small {
    color: var(--ft-auth-muted);
    line-height: 1.5;
}

.ft-auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

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

.ft-auth-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--ft-auth-purple);
}

.ft-auth-link {
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

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

.ft-auth-alert {
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
}

.ft-auth-alert.is-error {
    border: 1px solid rgba(180, 35, 24, .24);
    color: var(--ft-auth-danger);
    background: var(--ft-auth-danger-soft);
}

.ft-auth-alert.is-success {
    border: 1px solid rgba(6, 118, 71, .25);
    color: var(--ft-auth-success);
    background: var(--ft-auth-success-soft);
}

.ft-auth-submit {
    position: relative;
    min-height: 50px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 13px 18px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--ft-auth-purple), var(--ft-auth-purple-dark));
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.ft-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(79, 53, 198, .28);
}

.ft-auth-submit:disabled {
    cursor: wait;
    opacity: .82;
}

.ft-auth-submit-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.ft-auth-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ft-auth-spin .8s linear infinite;
}

.ft-auth-submit.is-loading .ft-auth-spinner {
    display: inline-block;
}

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

.ft-auth-footer {
    margin-top: 28px;
    color: var(--ft-auth-muted);
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.ft-auth-recovery-page {
    background:
        radial-gradient(circle at 18% 12%, rgba(19, 160, 133, .12), transparent 28%),
        linear-gradient(145deg, rgba(79, 53, 198, .94), rgba(23, 17, 63, .98));
}

.ft-auth-recovery-shell {
    width: min(560px, calc(100% - 40px));
    min-height: 100vh;
    padding: 32px 0;
}

.ft-auth-recovery-card {
    position: relative;
    width: 100%;
    padding: clamp(28px, 6vw, 54px);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(12, 8, 44, .25);
}

.ft-auth-recovery-lang {
    justify-content: center;
    margin-bottom: 26px;
}

.ft-auth-recovery-lang select {
    color: var(--ft-auth-indigo);
    background: var(--ft-auth-surface-soft);
    border-color: var(--ft-auth-border);
}

.ft-auth-recovery-header {
    text-align: center;
}

.ft-auth-recovery-header h1 {
    margin: 0 0 10px;
    color: var(--ft-auth-indigo);
    font-size: clamp(28px, 5vw, 40px);
    line-height: 1.2;
    letter-spacing: 0;
}

.ft-auth-recovery-logo {
    width: 150px;
    max-width: 48%;
    height: auto;
    margin: 0 auto 22px;
    display: block;
    object-fit: contain;
}

.ft-register-logo-main {
    width: 184px;
    height: auto;
    max-height: 106px;
    object-fit: contain;
}

@media (max-width: 860px) {
    .ft-auth-shell {
        width: min(100% - 20px, 680px);
        min-height: 100vh;
        padding: 10px 0;
    }

    .ft-auth-login {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .ft-auth-visual {
        min-height: 360px;
    }

    .ft-auth-panel {
        padding: 24px 20px 28px;
    }

    .ft-auth-recovery-shell {
        width: min(100% - 20px, 560px);
        padding: 10px 0;
    }

    .ft-auth-recovery-card {
        padding: 26px 20px;
    }

    .ft-auth-logo-main {
        width: min(360px, 100%);
        max-height: 190px;
    }

}

@media (min-width: 861px) and (max-height: 780px) {
    .ft-auth-shell {
        min-height: calc(100vh - 24px);
        padding: 12px 0;
    }

    .ft-auth-login {
        min-height: 0;
    }

    .ft-auth-visual,
    .ft-auth-panel {
        padding: 34px 44px;
    }

    .ft-auth-brand {
        gap: 18px;
    }

    .ft-auth-logo-main {
        width: min(360px, 100%);
        max-height: 172px;
        padding: 10px;
    }

    .ft-auth-brand h1 {
        font-size: 40px;
        line-height: 1.08;
    }

    .ft-auth-brand p {
        font-size: 15px;
        line-height: 1.45;
    }

    .ft-auth-panel-header {
        margin-bottom: 20px;
    }

    .ft-auth-panel-header h2 {
        font-size: 30px;
    }

    .ft-auth-form {
        gap: 14px;
    }

    .ft-auth-field input {
        min-height: 46px;
    }

    .ft-auth-footer {
        margin-top: 20px;
    }

    .ft-auth-recovery-logo {
        width: 126px;
    }
}

@media (max-width: 520px) {
    .ft-auth-visual {
        padding: 22px 18px;
    }

    .ft-auth-brand {
        gap: 18px;
    }

    .ft-auth-form-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
