/* ============================================================
   Songbook — Base + componentes compartilhados "Midnight Blue"
   Tudo escopado sob .midnight (aplicado pelos layouts novos)
   para não interferir nas páginas legadas durante a migração.
   Classes compartilhadas usam o prefixo sb-.
   ============================================================ */

/* ---------- Base ---------- */
.midnight {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--txt);
    color-scheme: dark;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    animation: sb-fade .35s ease;
}

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

.midnight a {
    color: inherit;
    text-decoration: none;
}

.midnight button {
    font-family: inherit;
}

.midnight .mono {
    font-family: var(--font-mono);
}

.midnight i.fa-solid, .midnight i.fa-regular, .midnight i.fa-brands {
    line-height: 1;
}

@keyframes sb-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.midnight ::selection {
    background: var(--accent-dim);
    color: var(--txt);
}

/* ---------- Botões ---------- */
.midnight .sb-btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    padding: 11px 20px;
    cursor: pointer;
    transition: .18s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.midnight .sb-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 24px -8px var(--accent);
}

.midnight .sb-btn-primary:hover {
    background: var(--accent2);
    transform: translateY(-1px);
}

.midnight .sb-btn-ghost {
    background: transparent;
    color: var(--txt);
    border: 1px solid var(--border2);
}

.midnight .sb-btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent2);
}

.midnight .sb-btn-danger {
    background: var(--danger);
    color: #fff;
}

.midnight .sb-btn-danger:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.midnight .sb-btn:disabled {
    opacity: .6;
    cursor: default;
    transform: none;
}

/* ---------- Chips e badges ---------- */
.midnight .sb-chip {
    font-size: 11.5px;
    color: var(--accent2);
    background: var(--accent-dim);
    border: 1px solid var(--chip-border);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

/* Badge de tonalidade (mono) */
.midnight .sb-key {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent2);
    background: var(--accent-dim);
    border: 1px solid var(--chip-border);
    padding: 3px 9px;
    border-radius: 6px;
}

/* ---------- Painéis ---------- */
.midnight .sb-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.midnight .sb-panel > h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.midnight .sb-panel > .ph {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 18px;
}

/* ---------- Formulários ---------- */
.midnight .sb-field {
    margin-bottom: 15px;
}

.midnight .sb-field label {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 7px;
    font-weight: 500;
}

.midnight .sb-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--txt);
    font-family: inherit;
    font-size: 14px;
    transition: .15s;
}

.midnight .sb-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.midnight .sb-input::placeholder {
    color: var(--muted2);
}

.midnight .sb-input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- Alerta de erro ---------- */
.midnight .sb-alert-err {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(245, 184, 75, .08);
    border: 1px solid var(--warn);
    color: var(--warn);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}

/* ---------- Campo de senha com toggle ---------- */
.midnight .sb-pwd-wrap {
    position: relative;
}

.midnight .sb-pwd-wrap input {
    padding-right: 44px;
}

.midnight .sb-pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 8px;
    transition: .15s;
}

.midnight .sb-pwd-toggle:hover {
    color: var(--accent2);
}

/* ---------- Split de autenticação (login/registro) ---------- */
.midnight .sb-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
}

.midnight .sb-auth .left {
    position: relative;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(150deg, #0C1122, #0A0F1E 55%, #0B1428);
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.midnight .sb-auth .left .glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 125, 255, .35), transparent 65%);
    top: -80px;
    right: -80px;
}

.midnight .sb-auth .left .logo {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    font-size: 20px;
    position: relative;
}

.midnight .sb-auth .left .logo .lg {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 15px;
}

.midnight .sb-auth .left .quote {
    position: relative;
    max-width: 420px;
}

.midnight .sb-auth .left .quote h2 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.5px;
}

.midnight .sb-auth .left .quote p {
    color: var(--muted);
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.midnight .sb-auth .left .mini {
    position: relative;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.midnight .sb-auth .left .mini .m {
    font-size: 13px;
    color: var(--muted);
}

.midnight .sb-auth .left .mini .m b {
    color: var(--accent2);
    font-size: 18px;
    display: block;
    margin-bottom: 4px;
}

.midnight .sb-auth .right {
    display: grid;
    place-items: center;
    padding: 40px;
}

.midnight .sb-auth .form {
    width: 100%;
    max-width: 380px;
}

.midnight .sb-auth .form h1 {
    font-size: 27px;
    font-weight: 800;
}

.midnight .sb-auth .form .lead {
    color: var(--muted);
    font-size: 14px;
    margin: 8px 0 26px;
}

.midnight .sb-auth .form .btn-enter {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.midnight .sb-auth .form .foot {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-top: 22px;
}

.midnight .sb-auth .form .foot a {
    color: var(--accent2);
    font-weight: 600;
}

@media (max-width: 1100px) {
    .midnight .sb-auth {
        grid-template-columns: 1fr;
    }

    .midnight .sb-auth .left {
        display: none;
    }
}

/* ---------- Página 404 (App.razor NotFound) ---------- */
.midnight .sb-notfound {
    min-height: 70vh;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 10px;
}

.midnight .sb-notfound h1 {
    font-size: 64px;
    font-weight: 800;
    background: linear-gradient(120deg, var(--accent), var(--accent-soft2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.midnight .sb-notfound p {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 16px;
}

.midnight .sb-notfound a {
    justify-self: center;
}

/* ---------- Validação (Blazor) ---------- */
.midnight .validation-message {
    color: var(--warn);
    font-size: 12px;
    margin-top: 5px;
}

.midnight .sb-input.invalid, .midnight .invalid.sb-input {
    border-color: var(--warn);
}
