/* =========================================================
   Rádio San Paolo — Folha de estilo (Brandbook)
   Paleta corporativa, tipografia e layout minimalista.
   Ajuste as variáveis em :root para adequar ao seu brandbook.
   ========================================================= */

:root {
    /* --- Paleta oficial San Paolo (brandbook) --- */
    --sp-vermelho: #DA0D17;       /* San Paolo (cor principal) */
    --sp-vermelho-esc: #a80a12;
    --sp-creme: #E8E1D0;          /* Ninho (base clara) */
    --sp-creme-claro: #F6F1E6;
    --sp-laranja: #DA5513;
    --sp-pistache: #4F7043;
    --sp-cafezinho: #56331B;
    --sp-morango: #F29C94;
    --sp-azul: #265D7C;

    /* --- Mapeamento semântico --- */
    --cor-primaria: var(--sp-vermelho);
    --cor-secundaria: var(--sp-laranja);
    --cor-acento: var(--sp-creme);
    --cor-fundo: var(--sp-creme);
    --cor-fundo-card: var(--sp-vermelho);
    --cor-texto: var(--sp-creme-claro);
    --cor-texto-suave: rgba(246, 241, 230, 0.75);

    /* --- Tipografia (Adobe Fonts com fallback) --- */
    --fonte-titulo: 'rocky', 'Fraunces', Georgia, serif;
    --fonte-corpo: 'arboria', 'Poppins', system-ui, sans-serif;

    /* --- Métricas --- */
    --raio: 22px;
    --sombra: 0 24px 60px rgba(86, 51, 27, 0.35);
    --transicao: 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* Garante que o atributo [hidden] esconda de fato elementos com display
   explícito (login/player usam grid/flex e sobrescreveriam o padrão). */
[hidden] {
    display: none !important;
}

body {
    font-family: var(--fonte-corpo);
    color: var(--cor-texto);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(218, 85, 19, 0.20), transparent 60%),
        radial-gradient(900px 500px at 100% 110%, rgba(79, 112, 67, 0.14), transparent 55%),
        var(--sp-creme);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;

    /* Impede seleção de texto e arraste — kiosk friendly */
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}

/* ===================== Cartão do player ===================== */
.player {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(165deg, var(--sp-vermelho), var(--sp-vermelho-esc));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 40px 36px 28px;
    text-align: center;
}

/* ===================== Marca / Logo ===================== */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand__logo {
    width: 96px;
    height: 96px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
    -webkit-user-drag: none;
}

.brand__name {
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--cor-texto);
}

/* ===================== Faixa atual ===================== */
.now-playing {
    margin-bottom: 22px;
    min-height: 120px;
}

.now-playing__badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(246, 241, 230, 0.16);
    color: var(--cor-texto);
    margin-bottom: 14px;
    transition: var(--transicao);
}

/* Estado especial quando está tocando propaganda */
.now-playing__badge.is-ad {
    background: var(--cor-secundaria);
    color: #fff;
}

.now-playing__label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cor-texto-suave);
    margin-bottom: 6px;
}

.now-playing__title {
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.25;
    color: var(--cor-texto);
    /* Evita quebrar layout com títulos longos */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.now-playing__artist {
    margin-top: 6px;
    font-size: 0.95rem;
    color: var(--cor-texto-suave);
}

/* ===================== Equalizador (decorativo) ===================== */
.equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 34px;
    margin-bottom: 26px;
    opacity: 0.35;
    transition: opacity var(--transicao);
}

.equalizer.is-active {
    opacity: 1;
}

.equalizer span {
    width: 5px;
    height: 8px;
    border-radius: 3px;
    background: var(--sp-creme-claro);
}

.equalizer.is-active span {
    animation: bar 1s ease-in-out infinite;
}

.equalizer span:nth-child(1) { animation-delay: 0s; }
.equalizer span:nth-child(2) { animation-delay: 0.2s; }
.equalizer span:nth-child(3) { animation-delay: 0.4s; }
.equalizer span:nth-child(4) { animation-delay: 0.15s; }
.equalizer span:nth-child(5) { animation-delay: 0.3s; }

@keyframes bar {
    0%, 100% { height: 8px; }
    50% { height: 30px; }
}

/* ===================== Controles ===================== */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.controls__play {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--sp-creme-claro);
    color: var(--sp-vermelho);
    display: grid;
    place-items: center;
    box-shadow: 0 12px 30px rgba(86, 51, 27, 0.45);
    transition: transform var(--transicao), background var(--transicao);
}

.controls__play:hover { transform: scale(1.05); }
.controls__play:active { transform: scale(0.96); }

.controls__play .icon {
    width: 34px;
    height: 34px;
    fill: var(--sp-vermelho);
}

/* Alterna ícones play/pause conforme estado no <body> */
.icon--pause { display: none; }
body.is-playing .icon--play { display: none; }
body.is-playing .icon--pause { display: block; }

/* ===================== Volume ===================== */
.controls__volume {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 260px;
}

.controls__volume .icon--vol {
    width: 22px;
    height: 22px;
    fill: var(--cor-texto-suave);
    flex-shrink: 0;
}

.controls__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(246, 241, 230, 0.28);
    outline: none;
    cursor: pointer;
}

.controls__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cor-acento);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.controls__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--cor-acento);
    cursor: pointer;
}

/* ===================== Rodapé de status ===================== */
.status {
    margin-top: 26px;
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cor-texto-suave);
    opacity: 0.7;
}

/* ===================== Tela de login ===================== */
.login {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 10;
}

.login__card {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(180deg, var(--cor-fundo-card), var(--cor-primaria));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 40px 32px;
    text-align: center;
}

.login__logo {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
}

.login__titulo {
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login__sub {
    color: var(--cor-texto-suave);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.login__label {
    display: block;
    text-align: left;
    font-size: 0.78rem;
    color: var(--cor-texto-suave);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login__input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
    color: var(--cor-texto);
    font-size: 1rem;
}

.login__input:focus {
    outline: none;
    border-color: var(--cor-acento);
}

.login__btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--cor-secundaria);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(200, 16, 46, 0.4);
}

.login__btn:disabled { opacity: 0.6; cursor: default; }

.login__erro {
    background: rgba(200, 16, 46, 0.15);
    color: #ffb4bf;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* ===================== Responsivo ===================== */
@media (max-width: 480px) {
    .player { padding: 32px 24px 24px; }
    .now-playing__title { font-size: 1.3rem; }
}
