/* =========================================================
   LOGIN.CSS — PREMIUM LIGHT LOGIN
   Дополнительные стили только для страницы авторизации.
   Базовые theme.css / layout.css остаются совместимыми.
   ========================================================= */

:root {
    --login-bg: #f7f9fc;
    --login-surface: rgba(255, 255, 255, .88);
    --login-surface-solid: #ffffff;
    --login-text: #27282b;
    --login-muted: #7c8189;
    --login-line: rgba(36, 39, 43, .10);
    --login-orange: #ef7d00;
    --login-orange-light: #ffb15c;
    --login-orange-soft: rgba(239, 125, 0, .10);
    --login-shadow: 0 30px 80px rgba(44, 35, 25, .12);
    --login-radius: 24px;
}

/* ---------- Сцена ---------- */

.premium-login {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    padding: 0 !important;
    color: var(--login-text);
    background:
        radial-gradient(circle at 12% 12%, rgba(239,125,0,.11), transparent 30%),
        radial-gradient(circle at 88% 86%, rgba(255,180,90,.12), transparent 32%),
        linear-gradient(135deg, #fbfcfe 0%, #f4f6f9 48%, #fff 100%);
}

.login-scene,
.login-scene * {
    pointer-events: none;
}

.login-scene {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.scene-grid {
    position: absolute;
    inset: -50%;
    opacity: .38;
    transform: rotate(-12deg);
    background-image:
        linear-gradient(rgba(239,125,0,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(239,125,0,.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 0%, transparent 68%);
    animation: gridDrift 22s linear infinite;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .72;
    will-change: transform;
}

.orb::after {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: inherit;
    border: 1px solid rgba(255,255,255,.75);
    box-shadow: inset 0 0 35px rgba(255,255,255,.35);
}

.orb-one {
    width: 360px;
    height: 360px;
    left: -100px;
    top: 6%;
    background: radial-gradient(circle at 35% 30%,
        rgba(255,191,116,.38),
        rgba(239,125,0,.10) 48%,
        transparent 72%);
    animation: orbFloatOne 13s ease-in-out infinite;
}

.orb-two {
    width: 470px;
    height: 470px;
    right: -160px;
    bottom: -130px;
    background: radial-gradient(circle at 40% 40%,
        rgba(255,210,160,.35),
        rgba(239,125,0,.08) 48%,
        transparent 72%);
    animation: orbFloatTwo 17s ease-in-out infinite;
}

.orb-three {
    width: 190px;
    height: 190px;
    right: 11%;
    top: 12%;
    background: radial-gradient(circle,
        rgba(239,125,0,.14),
        transparent 68%);
    animation: orbFloatThree 9s ease-in-out infinite;
}

.light-beam {
    position: absolute;
    width: 48vw;
    height: 170vh;
    top: -35vh;
    opacity: .17;
    filter: blur(18px);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.95),
        rgba(239,125,0,.13),
        transparent
    );
    transform: rotate(25deg);
}

.beam-one {
    left: 8%;
    animation: beamMoveOne 14s ease-in-out infinite;
}

.beam-two {
    right: -18%;
    opacity: .10;
    transform: rotate(-22deg);
    animation: beamMoveTwo 18s ease-in-out infinite;
}

.particles {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(239,125,0,.28) 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,255,255,.9) 1px, transparent 1.5px);
    background-size: 97px 97px, 137px 137px;
    background-position: 10px 20px, 50px 80px;
    opacity: .32;
    animation: particleDrift 26s linear infinite;
}

.noise {
    position: absolute;
    inset: 0;
    opacity: .025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ---------- Контейнер ---------- */

.premium-login .auth-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100svh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.premium-login .auth-container {
    width: min(100%, 440px);
    max-width: 440px;
    margin: 0 auto;
}

/* ---------- Бренд ---------- */

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin-bottom: 20px;
    animation: brandIn .8s cubic-bezier(.2,.8,.2,1) both;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(239,125,0,.14);
    box-shadow: 0 12px 30px rgba(239,125,0,.12);
    backdrop-filter: blur(12px);
}

.brand-mark img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.brand-kicker {
    color: var(--login-orange);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
}

.brand-name {
    color: #6c7077;
    font-size: 11px;
    font-weight: 600;
}

/* ---------- Карточка ---------- */

.premium-login .auth-card {
    position: relative;
    isolation: isolate;
    padding: 34px 36px 25px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: var(--login-radius);
    background: var(--login-surface);
    box-shadow:
        var(--login-shadow),
        0 2px 0 rgba(255,255,255,.95) inset;
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    animation: cardIn .85s cubic-bezier(.16,1,.3,1) .08s both;
    transform-style: preserve-3d;
    transition: transform .18s ease, box-shadow .25s ease;
}

.auth-card:hover {
    box-shadow:
        0 34px 90px rgba(44,35,25,.15),
        0 2px 0 rgba(255,255,255,.95) inset;
}

.card-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    right: -160px;
    top: -150px;
    z-index: -1;
    border-radius: 50%;
    background: rgba(239,125,0,.18);
    filter: blur(40px);
    animation: cardGlow 6s ease-in-out infinite alternate;
}

.card-line {
    position: absolute;
    left: 12%;
    right: 12%;
    top: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(239,125,0,.65),
        transparent
    );
}

/* ---------- Заголовок ---------- */

.auth-header {
    position: relative;
    margin-bottom: 28px;
    text-align: center;
}

.welcome-icon {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #fff7ef);
    border: 1px solid rgba(239,125,0,.16);
    box-shadow:
        0 12px 30px rgba(239,125,0,.10),
        inset 0 1px 0 white;
}

.welcome-icon .feather-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(1068%) hue-rotate(346deg) brightness(97%) contrast(101%);
}

.icon-pulse {
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(239,125,0,.16);
    border-radius: 21px;
    animation: iconPulse 2.4s ease-out infinite;
}

.auth-eyebrow {
    margin-bottom: 6px;
    color: var(--login-orange);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.premium-login .auth-title {
    margin-bottom: 7px;
    color: #242529;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: -.7px;
}

.premium-login .auth-description {
    color: var(--login-muted);
    font-size: 12px;
    line-height: 1.6;
}

/* ---------- Ошибка ---------- */

.login-alert {
    position: relative;
    padding: 11px 12px;
    margin: 0 0 18px;
    border: 1px solid rgba(220,53,69,.20) !important;
    border-radius: 13px !important;
    background: rgba(220,53,69,.065) !important;
    box-shadow: 0 8px 24px rgba(220,53,69,.06);
    animation: alertIn .45s cubic-bezier(.2,.8,.2,1) both;
}

.login-alert .alert-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: rgba(220,53,69,.10);
}

.login-alert .feather-icon {
    width: 15px;
    height: 15px;
    filter: none;
}

.login-alert .alert-text {
    color: #a52d3a;
    font-size: 11px;
    line-height: 1.45;
}

.login-alert .alert-close {
    color: #a52d3a;
    border: 0;
    background: transparent;
}

/* ---------- Поля ---------- */

.premium-form {
    margin: 0 !important;
}

.floating-field {
    margin-bottom: 18px;
}

.floating-field label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 7px 2px;
    color: #62666d;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .35px;
    transition: color .2s ease;
}

.field-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--login-orange-soft);
}

.field-icon .feather-icon {
    width: 13px;
    height: 13px;
    filter: brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(1068%) hue-rotate(346deg) brightness(97%) contrast(101%);
}

.input-shell {
    position: relative;
}

.input-shell input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--login-line);
    border-radius: 14px;
    outline: none;
    background: rgba(248,249,251,.88);
    color: #292b30;
    font-family: inherit;
    font-size: 13px;
    font-weight: 550;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.025);
    transition:
        border-color .22s ease,
        background .22s ease,
        box-shadow .22s ease,
        transform .22s ease;
}

.input-shell input::placeholder {
    color: transparent;
}

.input-shell input:hover {
    background: #fff;
    border-color: rgba(239,125,0,.18);
}

.input-shell input:focus {
    background: #fff;
    border-color: rgba(239,125,0,.55);
    box-shadow:
        0 0 0 4px rgba(239,125,0,.075),
        0 8px 22px rgba(239,125,0,.06);
    transform: translateY(-1px);
}

.floating-field:focus-within label {
    color: var(--login-orange);
}

.input-highlight {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--login-orange), #ffbf7c);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s ease;
}

.input-shell:focus-within .input-highlight {
    transform: scaleX(1);
}

.password-shell input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 38px;
    height: 38px;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
    transform: translateY(-50%) !important;
    background: transparent !important;
    color: #8a8e95 !important;
    border: 0 !important;
    box-shadow: none !important;
}

.password-toggle:hover {
    color: var(--login-orange) !important;
    transform: translateY(-50%) scale(1.04) !important;
}

.password-toggle .feather-icon {
    width: 17px;
    height: 17px;
    filter: none;
}

/* ---------- Кнопка ---------- */

.premium-button {
    position: relative;
    width: 100%;
    height: 54px;
    margin-top: 7px !important;
    overflow: hidden;
    border-radius: 15px !important;
    border: 0 !important;
    color: #fff !important;
    background: linear-gradient(110deg, #df6d00, #ef7d00 45%, #ff9b31) !important;
    box-shadow:
        0 13px 26px rgba(239,125,0,.23),
        0 2px 0 rgba(255,255,255,.18) inset;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease !important;
}

.premium-button:hover {
    transform: translateY(-2px) !important;
    filter: saturate(1.05);
    box-shadow:
        0 18px 34px rgba(239,125,0,.28),
        0 2px 0 rgba(255,255,255,.2) inset !important;
}

.premium-button:active {
    transform: translateY(0) scale(.99) !important;
}

.button-content {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .2px;
}

.button-icon {
    display: grid;
    place-items: center;
}

.button-icon .feather-icon {
    width: 17px;
    height: 17px;
}

.button-shine {
    position: absolute;
    z-index: 1;
    top: -80%;
    left: -40%;
    width: 25%;
    height: 260%;
    opacity: .28;
    transform: rotate(20deg);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.9),
        transparent
    );
    animation: buttonShine 3.8s ease-in-out infinite;
}

.button-loader {
    display: none;
    position: absolute;
    z-index: 3;
    width: 19px;
    height: 19px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.premium-button.is-loading .button-content {
    opacity: 0;
}

.premium-button.is-loading .button-loader {
    display: block;
}

.premium-button.is-loading {
    pointer-events: none;
}

/* ---------- Низ ---------- */

.auth-footer {
    padding-top: 22px;
    text-align: center;
}

.footer-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #a1a5ab;
    font-size: 9px;
}

.footer-divider::before,
.footer-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--login-line));
}

.footer-divider::after {
    background: linear-gradient(90deg, var(--login-line), transparent);
}

.auth-footer p {
    color: var(--login-muted);
    font-size: 11px;
}

.premium-login .auth-link {
    position: relative;
    color: var(--login-orange);
    font-weight: 750;
    text-decoration: none;
}

.premium-login .auth-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .25s ease;
}

.premium-login .auth-link:hover {
    color: #c86400;
}

.premium-login .auth-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 19px;
    padding-top: 16px;
    border-top: 1px solid rgba(36,39,43,.07);
    color: #a0a4aa;
    font-size: 9px;
    letter-spacing: .15px;
}

.security-note .feather-icon {
    width: 12px;
    height: 12px;
    filter: brightness(0) saturate(100%) invert(57%) sepia(67%) saturate(1072%) hue-rotate(346deg) brightness(99%) contrast(95%);
}

.security-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #35b96f;
    box-shadow: 0 0 0 3px rgba(53,185,111,.10);
    animation: securityPulse 2s ease-in-out infinite;
}

.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 17px;
    color: #a2a6ad;
    font-size: 9px;
    animation: fadeUp .7s ease .4s both;
}

.footer-dot {
    color: rgba(239,125,0,.55);
}

/* ---------- Валидация ---------- */

.input-shell.input-error input {
    border-color: rgba(220,53,69,.48);
    box-shadow: 0 0 0 4px rgba(220,53,69,.055);
}

.input-shell.input-success input {
    border-color: rgba(40,167,69,.35);
}

/* ---------- Анимации ---------- */

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes brandIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes iconPulse {
    0% { opacity: .75; transform: scale(.95); }
    70%, 100% { opacity: 0; transform: scale(1.12); }
}

@keyframes cardGlow {
    from { transform: translate3d(0,0,0) scale(1); }
    to { transform: translate3d(-25px,25px,0) scale(1.16); }
}

@keyframes orbFloatOne {
    0%,100% { transform: translate3d(0,0,0); }
    50% { transform: translate3d(35px,22px,0); }
}

@keyframes orbFloatTwo {
    0%,100% { transform: translate3d(0,0,0); }
    50% { transform: translate3d(-35px,-25px,0); }
}

@keyframes orbFloatThree {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(-18px,20px,0) scale(1.08); }
}

@keyframes beamMoveOne {
    0%,100% { transform: translateX(-10%) rotate(25deg); }
    50% { transform: translateX(35%) rotate(25deg); }
}

@keyframes beamMoveTwo {
    0%,100% { transform: translateX(12%) rotate(-22deg); }
    50% { transform: translateX(-28%) rotate(-22deg); }
}

@keyframes particleDrift {
    from { background-position: 10px 20px, 50px 80px; }
    to { background-position: 107px 117px, -87px -57px; }
}

@keyframes gridDrift {
    from { transform: translate3d(0,0,0) rotate(-12deg); }
    to { transform: translate3d(42px,42px,0) rotate(-12deg); }
}

@keyframes buttonShine {
    0%, 45% { left: -45%; }
    65%, 100% { left: 135%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes securityPulse {
    0%,100% { opacity: .7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.18); }
}

/* ---------- Mobile ---------- */

@media (max-width: 576px) {
    .premium-login .auth-wrapper {
        padding: 28px 14px;
        align-items: center;
    }

    .premium-login .auth-card {
        padding: 29px 21px 22px;
        border-radius: 21px;
    }

    .login-brand {
        margin-bottom: 14px;
    }

    .brand-mark {
        width: 45px;
        height: 45px;
        border-radius: 13px;
    }

    .brand-mark img {
        width: 32px;
        height: 32px;
    }

    .brand-name {
        font-size: 10px;
    }

    .premium-login .auth-title {
        font-size: 25px;
    }

    .orb-one {
        width: 260px;
        height: 260px;
        left: -140px;
    }

    .orb-two {
        width: 300px;
        height: 300px;
        right: -150px;
    }

    .login-footer {
        font-size: 8px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
