:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #1f2a44;
    --muted: #64748b;
    --line: #e6edf6;
    --brand: #2563eb;
    --shadow: 0 10px 30px rgba(16, 24, 40, .08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--text);
    background: var(--bg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 900;
}

.logo-b {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
}

.btn-link {
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    font-size: 13px;
}

.wrap {
    width: min(980px, 94%);
    margin: 16px auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    padding: 16px;
    margin-bottom: 14px;
}

.hero h1 {
    margin: 0 0 6px;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.auth-shell {
    padding: 12px;
}

.auth-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tab-btn {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.tab-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.form-card {
    display: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.form-card.active {
    display: block;
}

label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 700;
}

input,
select,
textarea,
button {
    width: 100%;
    font: inherit;
}

input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

textarea {
    resize: vertical;
}

button {
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
}

.alert.success {
    background: #ebfff1;
    border: 1px solid #b4f0c8;
    color: #0d7a39;
}

.alert.error {
    background: #fff2f2;
    border: 1px solid #fbc2c2;
    color: #b42318;
}

.profile-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
}

.profile-preview {
    padding: 14px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: #f1f5ff;
}

.presence-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #94a3b8;
}

.presence-dot.online {
    background: #22c55e;
}

.presence-dot.offline {
    background: #94a3b8;
}

.profile-preview h2 {
    margin: 10px 0 5px;
}

.profile-preview p {
    margin: 0 0 7px;
    color: var(--muted);
}

.profile-form {
    padding: 14px;
}

.profile-form .hint {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.profile-form .hint.error-text {
    color: #b42318;
}

.profile-video {
    width: 100%;
    border-radius: 12px;
    margin-top: 8px;
    background: #000;
}

@media (max-width: 850px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}
