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

:root {
    --clr-bg:       #1a1a2e;
    --clr-surface:  #16213e;
    --clr-border:   #0f3460;
    --clr-accent:   #e94560;
    --clr-text:     #eaeaea;
    --clr-muted:    #888;
    --clr-success:  #4caf50;
    --clr-danger:   #e94560;
    --radius:       8px;
    --font:         'Segoe UI', system-ui, sans-serif;
}

html, body {
    height: 100%;
    background: var(--clr-bg);
    color: var(--clr-text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}

.hidden { display: none !important; }

.screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.btn-primary {
    background: var(--clr-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: .75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-ghost {
    background: transparent;
    color: var(--clr-muted);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: .4rem .9rem;
    font-size: .875rem;
    cursor: pointer;
}
.btn-ghost:hover { color: var(--clr-text); }

.error-msg {
    color: var(--clr-danger);
    font-size: .875rem;
    margin-bottom: .5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.field label {
    font-size: .8rem;
    color: var(--clr-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.field input,
.field select,
.field textarea {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    color: var(--clr-text);
    padding: .6rem .75rem;
    font-size: 1rem;
    width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--clr-accent);
}

/* ── User menu (avatar button + dropdown) ─────────────────── */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid var(--clr-border);
    background: transparent;
    color: var(--clr-muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0;
}
.user-menu-btn:hover { background: rgba(255,255,255,.07); color: var(--clr-text); border-color: var(--clr-muted); }
.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    min-width: 140px;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    display: none;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
}
.user-menu-dropdown.open { display: flex; }
.user-menu-item {
    display: block;
    width: 100%;
    padding: .6rem 1rem;
    font-size: .88rem;
    color: var(--clr-text);
    text-decoration: none;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    line-height: 1.4;
}
.user-menu-item:hover { background: rgba(255,255,255,.06); }
.user-menu-item.danger { color: var(--clr-danger); }
