:root {
    --bg-card: rgba(20, 21, 26, 0.96);
    --bg-input: #17181c;
    --brand-main: #3b66f5;
    --brand-hover: #5077fa;
    --accent-red: #ff3333;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(59, 102, 245, 0.4);
    --text-main: #ffffff;
    --text-muted: #838a9b;
    --error: #ff4757;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Proxima Nova', 'Montserrat', sans-serif;
    overflow: hidden;
    user-select: none;
    height: 100%;
    width: 100%;
    background: transparent;
}

#auth-screen {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease;
    background: transparent;
    z-index: 0;
}

.auth-glow {
    position: fixed;
    top: 0;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.auth-glow--left {
    left: 0;
    width: min(48vw, 620px);
    background: radial-gradient(ellipse 120% 85% at 0% 50%, rgba(59, 102, 245, 0.15) 0%, transparent 70%);
}

.auth-glow--right {
    right: 0;
    width: min(48vw, 620px);
    background: radial-gradient(ellipse 120% 85% at 100% 50%, rgba(59, 102, 245, 0.15) 0%, transparent 70%);
}

.auth-brand-logo {
    position: fixed;
    top: 24px;
    right: 30px;
    left: auto;
    height: 52px;
    width: auto;
    z-index: 20;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.auth-features {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 5;
    max-width: 320px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0;
}

.feature-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: 0.3s;
    border: none;
}

.f-box-1 { background: #52b788; box-shadow: 0 0 16px rgba(82, 183, 136, 0.5); }
.f-box-2 { background: #e63946; box-shadow: 0 0 16px rgba(230, 57, 70, 0.5); }
.f-box-3 { background: #f4a261; box-shadow: 0 0 16px rgba(244, 162, 97, 0.5); }
.f-box-4 { background: #457b9d; box-shadow: 0 0 16px rgba(69, 123, 157, 0.5); }
.f-box-5 { background: #555df0; box-shadow: 0 0 16px rgba(85, 93, 240, 0.5); }

.feature-line {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.auth-support {
    position: fixed;
    bottom: 40px;
    left: 5%;
    width: 250px;
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 15;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.auth-support:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.auth-support:active {
    transform: translateY(0);
}

.support-text {
    display: flex;
    flex-direction: column;
}

.support-text span {
    font-size: 13px;
    font-weight: 800;
    color: #111214;
}

.support-text small {
    font-size: 10px;
    font-weight: 600;
    color: #555866;
    margin-top: 2px;
}

.support-arrow svg {
    width: 18px;
    height: 18px;
    stroke: #111214;
    stroke-width: 2;
    fill: none;
}

.auth-card {
    width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.auth-header {
    padding: 25px 0 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: var(--brand-main);
    box-shadow: 0 0 12px var(--brand-main);
}

.auth-header-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(to right, #ffffff, #a3b8ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card-body {
    padding: 35px 45px 45px;
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.auth-panel[hidden] {
    display: none !important;
}

.reg-progress-wrap {
    width: 100%;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.reg-progress-wrap[hidden] {
    display: none !important;
}

.reg-step-badge {
    background: rgba(59, 102, 245, 0.15);
    border: 1px solid rgba(59, 102, 245, 0.3);
    color: #8da6ff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(59, 102, 245, 0.1);
}

.progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brand-main);
    width: 16.66%;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 8px var(--brand-main);
    border-radius: 2px;
}

.reg-step {
    display: none;
    flex-direction: column;
    flex: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.reg-step.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.panel-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
    margin-bottom: 25px;
}

.panel-title {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    text-align: center;
}

.reg-desc {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.step-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.step-body--skin,
.step-body--rules {
    justify-content: flex-start;
}

.auth-input-group {
    position: relative;
    width: 100%;
    height: 54px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    transition: 0.2s;
    flex-shrink: 0;
}

.auth-input-group:focus-within {
    border-color: var(--brand-main);
    box-shadow: 0 0 0 4px var(--border-focus);
}

.auth-input-group.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.15);
}

.auth-input-group--readonly {
    opacity: 0.85;
}

.icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.icon-left svg {
    width: 18px !important;
    height: 18px !important;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.input-extras {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-badge {
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
    transition: 0.2s;
    user-select: none;
}

.icon-right {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    outline: none;
}

.icon-right svg {
    width: 18px !important;
    height: 18px !important;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    transition: 0.2s;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.icon-right:hover svg,
.toggle-pass-btn.is-visible svg {
    stroke: white;
}

.auth-input-group input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 85px 0 46px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.auth-input-group input.no-eye {
    padding-right: 55px;
}

.auth-input-group input::placeholder {
    color: var(--text-muted);
}

.btn-row {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #e4e9f7 100%);
    color: #111522;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    height: 54px;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.auth-submit-btn:hover {
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    height: 54px;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    flex-shrink: 0;
}

.auth-btn-secondary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-forgot-box {
    width: 100%;
    margin-top: 20px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s;
}

.auth-forgot-box:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.auth-forgot-box a {
    display: block;
    padding: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-forgot-box a:hover {
    color: #fff;
}

#auth-forgot-wrap.is-hidden {
    display: none;
}

.reg-error {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.35);
    color: var(--error);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    text-align: center;
}

.reg-error[hidden] {
    display: none !important;
}

.auth-screen--skin-step .auth-card {
    left: auto;
    right: 5%;
    transform: translateY(-50%);
    width: 400px;
}

.gender-box {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 15px;
}

.btn-gender {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.btn-gender.active {
    background: var(--brand-main);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 15px rgba(59, 102, 245, 0.3);
}

.skin-picker-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
    display: block;
}

.skin-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--border-light);
    height: 100px;
}

.skin-arrow {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.skin-arrow svg {
    width: 24px !important;
    height: 24px !important;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    transition: 0.2s;
}

.skin-arrow:hover svg {
    stroke: white;
    transform: scale(1.1);
}

.skin-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.skin-counter {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
}

#reg-skin-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-main);
}

.skin-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.skin-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: 0.2s;
}

.skin-dot.active {
    background: var(--brand-main);
    box-shadow: 0 0 10px var(--brand-main);
    transform: scale(1.3);
}

.skin-preview-zone {
    position: fixed;
    left: 40%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 600px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.auth-screen--skin-step .skin-preview-zone {
    opacity: 1;
}

.auth-card--wide {
    width: 680px;
}

.rules-content-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    height: 240px;
    overflow-y: auto;
    padding: 25px;
    margin-bottom: 20px;
}

.rules-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.rules-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.rules-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rules-text {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rules-block {
    opacity: 0;
    transform: translateY(15px);
}

.reg-step.active .rules-block {
    animation: slideUpFade 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.reg-step.active .rules-block:nth-child(1) { animation-delay: 0.1s; }
.reg-step.active .rules-block:nth-child(2) { animation-delay: 0.2s; }
.reg-step.active .rules-block:nth-child(3) { animation-delay: 0.3s; }
.reg-step.active .rules-block:nth-child(4) { animation-delay: 0.4s; }
.reg-step.active .rules-block:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rules-block h3 {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rules-block h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 14px;
    background: var(--brand-main);
    border-radius: 2px;
}

.rules-block p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.checks-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-bottom: 15px;
}

.cb-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    line-height: 1.4;
    padding: 4px 0;
    transition: 0.2s;
}

.cb-item:hover {
    opacity: 0.8;
}

.cb-item input {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-main);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: -1px;
}

#toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(240, 66, 69, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(240, 66, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDownFadeToast 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.toast svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

@keyframes slideDownFadeToast {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#auth-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

#auth-loader.is-fading {
    opacity: 0;
    pointer-events: none;
}

#auth-loader[hidden] {
    display: none !important;
}

.load-scene {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.load-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

.load-glow--purple {
    width: 350px;
    height: 350px;
    background: #555df0;
    margin-left: -30px;
    animation: pulse-glow-purple 3s ease-in-out infinite alternate;
}

.load-glow--cyan {
    width: 280px;
    height: 280px;
    background: #6df7f2;
    margin-left: 30px;
    margin-top: 30px;
    animation: pulse-glow-cyan 2.4s ease-in-out infinite alternate;
}

.load-gerb-wrap {
    position: relative;
    z-index: 1;
}

.load-gerb {
    max-width: 200px;
    height: auto;
    display: block;
    pointer-events: none;
    filter:
        drop-shadow(0 0 20px rgba(109, 247, 242, 1))
        drop-shadow(0 0 50px rgba(85, 93, 240, 0.9))
        drop-shadow(0 0 80px rgba(85, 93, 240, 0.6));
}

@keyframes pulse-glow-purple {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.95; }
}

@keyframes pulse-glow-cyan {
    0% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.85; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
}
