.auth-page {
    min-height: calc(100dvh - var(--header-height, 70px));
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, var(--bg-panel) 0%, var(--bg-base) 100%);
    padding: 20px;
    box-sizing: border-box;
}

.auth-container {
    background: rgba(var(--bg-panel-rgb), 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-lighter);
    border-radius: 12px;
    padding: 35px 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 25px 20px;
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-error-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    width: 90%;
    max-width: 400px;
    z-index: 9999;
    background: rgba(var(--danger-rgb), 0.15);
    border: 1px solid rgba(var(--danger-rgb), 0.4);
    color: var(--danger);
    font-size: 0.9rem;
    padding: 12px 15px;
    text-align: center;
    font-weight: 500;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.95);
    box-sizing: border-box;
}

.panel-error-bar.success { background: rgba(var(--success-rgb), 0.15); border-color: rgba(var(--success-rgb), 0.4); color: var(--success); }
.panel-error-bar.visible { display: block; opacity: 1; transform: translateX(-50%) translateY(0) scale(1); animation: popInToast 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.panel-error-bar.hiding { display: block; animation: popOutToast 0.3s ease-in forwards; }

@keyframes popInToast { from { transform: translateX(-50%) translateY(20px) scale(0.95); opacity: 0; } to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; } }
@keyframes popOutToast { from { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; } to { transform: translateX(-50%) translateY(20px) scale(0.95); opacity: 0; } }

.auth-tabs { display: flex; background: var(--bg-header-tabs); border-radius: 8px; padding: 6px; margin-bottom: 30px; }
.tab-btn { flex: 1; padding: 12px; background: transparent; border: none; color: var(--text-muted); font-size: 1rem; font-weight: 600; cursor: pointer; border-radius: 6px; transition: all 0.2s ease; }
@media (hover: hover) { .tab-btn:hover:not(.active) { color: var(--text-main); } }
.tab-btn.active { background: var(--bg-input); color: var(--text-pure); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.form-group { margin-bottom: 22px; }
.form-group label { display: block; color: var(--text-main); font-size: 0.9rem; font-weight: 500; margin-bottom: 8px; margin-left: 2px; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-muted); transition: all 0.2s; z-index: 5; pointer-events: none; }
.input-wrapper input { width: 100%; box-sizing: border-box; padding: 14px 44px 14px 44px; background: var(--bg-base); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-pure); font-size: 1rem; transition: all 0.2s; }
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15); background: rgba(var(--primary-rgb), 0.05); }
.input-wrapper input:focus ~ .input-icon { color: var(--primary); }

.username-tag-wrapper { display: flex; align-items: stretch; background: transparent; padding: 0; }
.username-tag-wrapper:focus-within { box-shadow: none; }
.username-tag-wrapper .input-left { flex: 1; background: var(--bg-base) !important; border: 1px solid var(--border-color) !important; border-right: none !important; border-radius: 8px 0 0 8px; padding: 14px 5px 14px 44px !important; color: var(--text-pure); transition: all 0.2s; position: relative; z-index: 2; clip-path: inset(-5px 0 -5px -5px); }
.username-tag-wrapper .input-left:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15) !important; background: rgba(var(--primary-rgb), 0.05) !important; }
.username-tag-wrapper .input-left:focus ~ .input-icon { color: var(--primary); }
.tag-divider { box-sizing: border-box; background: var(--bg-base); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-weight: bold; font-size: 1rem; padding: 0 8px; display: flex; align-items: center; transition: all 0.2s; z-index: 1; }
.username-tag-wrapper .input-right { width: 75px; background: var(--bg-base) !important; border: 1px solid var(--border-color) !important; border-left: none !important; border-radius: 0 8px 8px 0; padding: 14px 14px 14px 0 !important; color: var(--text-dim) !important; font-family: 'Roboto Mono', monospace; letter-spacing: 1px; text-align: center; transition: all 0.2s; position: relative; z-index: 2; clip-path: inset(-5px -5px -5px 0); }
.username-tag-wrapper .input-right:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15) !important; background: rgba(var(--primary-rgb), 0.05) !important; color: var(--primary) !important; }
.username-tag-wrapper .input-right:focus + .tag-divider { color: var(--primary); }

.username-tag-wrapper.has-error .input-left, .username-tag-wrapper.has-error .input-right { border-color: var(--danger) !important; background: rgba(var(--danger-rgb), 0.05) !important; }
.username-tag-wrapper.has-error .tag-divider { border-top-color: var(--danger); border-bottom-color: var(--danger); background: rgba(var(--danger-rgb), 0.05); color: var(--danger); }
.username-tag-wrapper.has-error .input-icon { color: var(--danger); }
.username-tag-wrapper.has-error .input-left:focus, .username-tag-wrapper.has-error .input-right:focus { box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.15) !important; }

.label-group { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; margin-left: 2px; }
.label-group label { margin-bottom: 0; }
.tooltip-container { position: relative; display: flex; align-items: center; cursor: help; z-index: 50; }
.info-icon { display: flex; justify-content: center; align-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--text-muted); color: var(--text-muted); font-size: 10px; font-weight: bold; font-family: serif; transition: all 0.2s; }
@media (hover: hover) { .tooltip-container:hover .info-icon { color: var(--primary); border-color: var(--primary); } }
.tooltip-text { visibility: hidden; width: 260px; background-color: var(--bg-item); color: var(--text-pure); text-align: center; border-radius: 6px; padding: 12px; position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%) translateY(10px); opacity: 0; transition: opacity 0.2s, transform 0.2s; font-size: 0.8rem; font-weight: normal; line-height: 1.4; box-shadow: 0 10px 25px rgba(0,0,0,0.5); border: 1px solid var(--border-lighter); pointer-events: none; }
.tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: var(--bg-item) transparent transparent transparent; }
@media (hover: hover) { .tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); } }
.tooltip-container:active .tooltip-text, .tooltip-container:focus-within .tooltip-text { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); }

input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none !important; width: 0 !important; height: 0 !important; visibility: hidden !important; }
input[type="password"]::-webkit-contacts-auto-fill-button, input[type="password"]::-webkit-credentials-auto-fill-button { display: none !important; visibility: hidden !important; }
.toggle-password { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.2s; }
@media (hover: hover) { .toggle-password:hover { color: var(--text-main); } }
.toggle-password svg { width: 20px; height: 20px; }

.input-wrapper.has-error input { border-color: var(--danger); color: var(--danger); background: rgba(var(--danger-rgb), 0.05); }
.input-wrapper.has-error .input-icon { color: var(--danger); }

.password-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; font-size: 0.85rem; color: var(--text-muted); }
.criterion { display: flex; align-items: center; gap: 6px; transition: color 0.3s ease; }
.criterion .icon { font-size: 0.75rem; }
.criterion.valid { color: var(--success); }
.criterion.error { color: var(--danger); font-weight: bold; }

.form-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-size: 0.9rem; flex-wrap: wrap; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; color: var(--text-main); cursor: pointer; font-size: 0.9rem; margin: 0; transition: color 0.2s; }
.checkbox-label input { display: none; }
.custom-checkbox { width: 18px; height: 18px; border: 2px solid var(--text-muted); border-radius: 4px; background: var(--bg-base); display: flex; justify-content: center; align-items: center; transition: all 0.2s; flex-shrink: 0; }
.checkbox-label input:checked + .custom-checkbox { background: var(--primary); border-color: var(--primary); }
.checkbox-label input:checked + .custom-checkbox::after { content: "✓"; color: white; font-size: 14px; font-weight: bold; }
.