/* ============================================
   MÓDULO TV — painel do usuário (logado)
   Identidade visual alinhada com forms novos.
   ============================================ */

/* Header compacto: onda sobe quase encostando no menu */
body:has(#cssmenu) header.tv-header {
    min-height: 60px !important;
    padding: 0 var(--space-4) !important;
    background-size: 80px 32px !important;
}
body:has(#cssmenu) header.tv-header #logoCompany {
    display: none !important;
}

.tv-page {
    max-width: 880px;
    margin: 32px auto 80px;
    padding: 0 20px;
}

.tv-hero {
    text-align: center;
    margin-bottom: 28px;
}
.tv-hero .hero-logo {
    display: inline-block;
    margin-bottom: 14px;
}
.tv-hero .hero-logo img {
    display: block;
    max-height: 64px;
    max-width: 180px;
    object-fit: contain;
    /* Contorno acompanhando o formato do logo (drop-shadow empilhado em 8 direções) */
    filter:
        drop-shadow( 2px  0 0 #fff)
        drop-shadow(-2px  0 0 #fff)
        drop-shadow( 0  2px 0 #fff)
        drop-shadow( 0 -2px 0 #fff)
        drop-shadow( 1.5px  1.5px 0 #fff)
        drop-shadow(-1.5px  1.5px 0 #fff)
        drop-shadow( 1.5px -1.5px 0 #fff)
        drop-shadow(-1.5px -1.5px 0 #fff)
        drop-shadow(0 4px 8px rgba(15, 36, 34, 0.18));
}
.tv-hero h1 {
    font-size: 28px;
    color: #fff;
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow:
        0 1px 2px rgba(15, 36, 34, 0.18),
        0 4px 12px rgba(15, 36, 34, 0.20);
}
.tv-hero .hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
.tv-hero .hero-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.tv-card {
    background: #fff;
    border: 1px solid #e3e9e8;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow:
        0 1px 2px rgba(15, 36, 34, 0.04),
        0 8px 24px rgba(15, 36, 34, 0.06);
}

.tv-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e3e9e8;
}
.tv-card-header .icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e6f4f2;
    color: #00766b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tv-card-header .icon svg { width: 22px; height: 22px; }
.tv-card-header h2 {
    font-size: 18px;
    color: #0f2422;
    margin: 0 0 4px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.tv-card-header .sub {
    color: #7a8b89;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

/* Card "Código de acesso" */
.tv-codigo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.tv-codigo-display {
    flex: 1;
    min-width: 180px;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 32px;
    font-weight: 700;
    color: #00766b;
    letter-spacing: 0.18em;
    background: #f4f8f7;
    border: 1px dashed #b8d4cf;
    border-radius: 10px;
    padding: 14px 18px;
    text-align: center;
    user-select: all;
}
.tv-btn-copy {
    padding: 11px 18px;
    background: #fff;
    color: #00766b;
    border: 1.5px solid #b8d4cf;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s ease-out, border-color .15s ease-out;
}
.tv-btn-copy:hover {
    background: #e6f4f2;
    border-color: #00766b;
}
.tv-btn-copy svg { width: 16px; height: 16px; }
.tv-btn-copy.copied {
    background: #00766b;
    color: #fff;
    border-color: #00766b;
}

.tv-codigo-info {
    margin-top: 14px;
    padding: 12px 14px;
    background: #f4f8f7;
    border-radius: 8px;
    font-size: 13px;
    color: #5a6b6a;
    line-height: 1.5;
}
.tv-codigo-info strong { color: #0f2422; }

.tv-qr-row {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e3e9e8;
}
#tv-qr-canvas {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    background: #fff;
    border: 1px solid #e3e9e8;
    border-radius: 8px;
    padding: 4px;
}
.tv-qr-text {
    font-size: 13px;
    color: #5a6b6a;
    line-height: 1.5;
}
.tv-qr-text strong { color: #0f2422; }

/* Card "Tempo por slide" */
.tv-tempo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 480px) {
    .tv-tempo-grid { grid-template-columns: repeat(2, 1fr); }
}
.tv-tempo-opt {
    cursor: pointer;
    padding: 14px 10px;
    background: #fff;
    border: 1.5px solid #cfd8d7;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1f3a37;
    text-align: center;
    transition: all .15s ease-out;
}
.tv-tempo-opt:hover { border-color: #a4b2b0; }
.tv-tempo-opt.active {
    background: #e6f4f2;
    border-color: #00766b;
    color: #00766b;
}

/* Card "Imagens" */
.tv-imagens-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.tv-imagens-counter {
    font-size: 13px;
    color: #7a8b89;
}
.tv-imagens-counter strong { color: #0f2422; }

/* especificidade aumentada (#content label tem display:block, color:white global) */
#content label.tv-dropzone,
.tv-dropzone {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    margin: 0 !important;
    border: 2px dashed #b8d4cf;
    border-radius: 12px;
    background: #f4f8f7;
    text-align: center;
    cursor: pointer;
    color: #0f2422 !important;
    text-shadow: none !important;
    transition: background .15s ease-out, border-color .15s ease-out;
}
#content label.tv-dropzone:hover,
.tv-dropzone:hover,
.tv-dropzone.is-dragover {
    background: #e6f4f2;
    border-color: #00766b;
}
.tv-dropzone svg { width: 36px; height: 36px; color: #00766b; margin-bottom: 10px; }
.tv-dropzone .title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #0f2422;
    margin-bottom: 4px;
    text-shadow: none;
}
.tv-dropzone .sub {
    display: block;
    font-size: 13px;
    color: #7a8b89;
    text-shadow: none;
    font-weight: normal;
}
.tv-dropzone input[type="file"] { display: none; }

.tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.tv-img-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f8f7;
    border: 1px solid #e3e9e8;
    cursor: grab;
}
.tv-img-card.is-dragging { opacity: 0.5; cursor: grabbing; }
.tv-img-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.tv-img-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 36, 34, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s, background .15s;
}
.tv-img-card:hover .tv-img-delete { opacity: 1; }
.tv-img-delete:hover { background: #c0392b; }
.tv-img-delete svg { width: 14px; height: 14px; }
.tv-img-ordem {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(15, 36, 34, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
}

.tv-empty {
    text-align: center;
    padding: 40px 20px;
    color: #7a8b89;
    font-size: 14px;
}

.tv-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #00766b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 118, 107, 0.3);
    opacity: 0;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
    pointer-events: none;
}
.tv-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.tv-toast.is-error { background: #c0392b; box-shadow: 0 8px 24px rgba(192, 57, 43, 0.3); }


/* ============================================
   PLAYER (público, sem auth)
   Fullscreen preto, mínimo de UI.
   ============================================ */
body.tv-player-body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    font-family: Tahoma, Geneva, "Segoe UI", sans-serif;
    color: #fff;
}
.tv-player-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #000;
}
.tv-player-img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 100%;
    max-height: 100%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: 0;
    -webkit-transition: opacity .5s ease-in-out;
    transition: opacity .5s ease-in-out;
}
.tv-player-img.is-active { opacity: 1; }

.tv-player-state {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
}
.tv-player-state svg {
    width: 64px;
    height: 64px;
    color: #00766b;
    margin-bottom: 20px;
}
.tv-player-state h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px;
}
.tv-player-state p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}
.tv-player-state .codigo-display {
    margin-top: 20px;
    font-family: monospace;
    font-size: 32px;
    font-weight: 700;
    color: #00766b;
    letter-spacing: 0.2em;
}

.tv-player-exit {
    position: fixed;
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    opacity: 0;
    -webkit-transition: opacity .3s;
    transition: opacity .3s;
}
.tv-player-exit.is-visible { opacity: 0.6; }
.tv-player-exit:hover { opacity: 1; }


/* ============================================
   ABAS Login / Acessar TV (na tela de login)
   ============================================ */
.login-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f4f8f7;
    border: 1px solid #e3e9e8;
    border-radius: 10px;
    margin-bottom: 22px;
}
.login-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    color: #5a6b6a;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.login-tab:hover {
    color: #0f2422;
    background: rgba(255,255,255,0.6);
}
.login-tab.is-active {
    background: #fff;
    color: #00766b;
    box-shadow: 0 1px 2px rgba(15,36,34,0.06);
}

/* Campo de código TV — herda fonte sans normal pra parecer com os outros inputs */
.tv-codigo-input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #cfd8d7;
    border-radius: 10px;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: center;
    color: #00766b;
    box-sizing: border-box;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
#waterform .tv-codigo-input:focus,
.tv-codigo-input:focus {
    outline: none;
    border-color: #00766b !important;
    box-shadow: 0 0 0 4px rgba(0, 118, 107, 0.14) !important;
}
.tv-codigo-input::placeholder {
    color: #cfd8d7;
    letter-spacing: 0.2em;
}

.tv-codigo-submit {
    margin-top: 12px;
    width: 100%;
    padding: 13px 18px;
    background: #00766b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 118, 107, 0.25);
    transition: background .15s, transform .05s, box-shadow .15s;
}
.tv-codigo-submit:hover {
    background: #005f56;
    box-shadow: 0 6px 16px rgba(0, 118, 107, 0.32);
    transform: translateY(-1px);
}
.tv-codigo-submit:active { transform: translateY(0); }

.tv-codigo-help {
    margin-top: 12px;
    font-size: 13px;
    color: #7a8b89;
    text-align: center;
    line-height: 1.4;
}
.tv-codigo-err {
    margin-top: 8px;
    font-size: 13px;
    color: #c0392b;
    text-align: center;
    display: none;
}
.tv-codigo-err.is-visible { display: block; }
