/* ===== Portalflix — Design System ===== */
:root {
    --bg: #141414;
    --bg-elev: #1f1f1f;
    --bg-card: #2a2a2a;
    --text: #ffffff;
    --text-mute: #b3b3b3;
    --brand: #e50914;
    --brand-hover: #f6121d;
    --border: rgba(255,255,255,.08);
    --shadow: 0 10px 40px rgba(0,0,0,.6);
    --radius: 6px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: 'Helvetica Neue', Arial, sans-serif; min-height:100%; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* Top nav */
.nav {
    position: fixed; top:0; left:0; right:0; z-index:50;
    display:flex; align-items:center; gap:24px;
    padding: 14px 4%;
    background: linear-gradient(180deg, rgba(0,0,0,.85), transparent);
    transition: background .3s;
}
.nav.scrolled { background: var(--bg); }
.nav .logo { color: var(--brand); font-weight: 900; font-size: 26px; letter-spacing: -1px; }
.nav ul { display:flex; gap:18px; list-style:none; }
.nav ul a { color: #e5e5e5; font-size: 14px; }
.nav ul a:hover { color: var(--text-mute); }
.nav .right { margin-left:auto; display:flex; align-items:center; gap:16px; }
.nav input[type=search] {
    background: rgba(0,0,0,.65); border:1px solid #555; color:#fff;
    padding:6px 10px; border-radius:4px; font-size:13px; width:200px;
}
.nav .avatar { width:32px; height:32px; border-radius:4px; background: var(--brand); display:flex; align-items:center; justify-content:center; font-weight:700; }

/* Hero / banner */
.hero {
    position: relative;
    height: 80vh; min-height: 480px;
    background-size: cover; background-position: center;
    display:flex; align-items:flex-end;
    padding: 0 4% 10vh;
    margin-top: -56px;
}
.hero::after {
    content:""; position:absolute; inset:0;
    background: linear-gradient(180deg, rgba(20,20,20,.4) 0%, rgba(20,20,20,.2) 50%, var(--bg) 100%);
}
.hero-inner { position:relative; z-index:1; max-width: 580px; }
.hero h1 { font-size: clamp(28px, 5vw, 60px); font-weight: 900; line-height:1.05; margin-bottom:14px; }
.hero p { color:#e5e5e5; font-size: 16px; line-height:1.45; margin-bottom: 18px; max-width: 480px; }
.hero .actions { display:flex; gap:10px; }

.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 22px; border-radius:4px; font-weight:700; border:0; font-size:15px; transition: all .15s; }
.btn-primary { background:#fff; color:#000; }
.btn-primary:hover { background:#e5e5e5; }
.btn-secondary { background: rgba(109,109,110,.7); color:#fff; }
.btn-secondary:hover { background: rgba(109,109,110,.4); }
.btn-brand { background: var(--brand); color:#fff; }
.btn-brand:hover { background: var(--brand-hover); }
.btn-ghost { background: transparent; color: #fff; border:1px solid #555; }
.btn-icon { width:42px; height:42px; padding:0; border-radius:50%; justify-content:center; border:2px solid rgba(255,255,255,.5); background: rgba(42,42,42,.6); color:#fff; }
.btn-icon:hover { border-color:#fff; }

/* Rows / carrosséis */
.row { padding: 0 4%; margin: 30px 0; }
.row h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.row-track { display:flex; gap:8px; overflow-x: auto; scroll-behavior: smooth; padding-bottom: 8px; }
.row-track::-webkit-scrollbar { height: 6px; }
.row-track::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.card {
    flex: 0 0 220px; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden;
    background: var(--bg-card) center/cover no-repeat;
    position: relative; transition: transform .25s; cursor: pointer;
}
.card:hover { transform: scale(1.06); z-index: 5; box-shadow: var(--shadow); }
.card .card-title {
    position: absolute; bottom: 0; left:0; right:0; padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
    font-size: 13px; font-weight: 600;
    opacity:0; transition: opacity .2s;
}
.card:hover .card-title { opacity:1; }
.card.poster { aspect-ratio: 2/3; flex-basis: 160px; }

/* Grid */
.grid { display:grid; gap:14px; padding: 0 4%;
    grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); }
.grid .card { flex: unset; aspect-ratio: 2/3; }

/* Forms / Auth pages */
.auth-shell { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding: 80px 20px 40px;
    background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.7)), url('/assets/img/auth-bg.svg') center/cover; }
.auth-card { background: rgba(0,0,0,.78); padding: 50px 60px; border-radius: 6px; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 30px; font-weight: 700; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field input, .field select, .field textarea {
    width:100%; padding: 14px 16px; background:#333; color:#fff; border:0; border-radius:4px; font-size:15px;
    border-bottom: 2px solid transparent;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--brand); }
.field label { display:block; margin-bottom:6px; font-size:13px; color: var(--text-mute); }
.btn-block { width:100%; padding: 14px; font-size: 16px; }
.error { color: #ff8080; font-size: 13px; margin-top: 6px; }
.muted { color: var(--text-mute); font-size: 14px; }
.muted a { color: #fff; }

/* Profiles selection */
.profiles-shell { min-height: 100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding: 40px 20px; }
.profiles-shell h1 { font-size: clamp(24px, 4vw, 56px); font-weight: 400; margin-bottom: 30px; }
.profiles-list { display:flex; flex-wrap:wrap; gap:24px; justify-content:center; }
.profile-tile { display:flex; flex-direction:column; align-items:center; gap:10px; cursor: pointer; }
.profile-tile .avatar-lg { width: 140px; height: 140px; border-radius: 8px; background: linear-gradient(135deg,#e50914,#831010); display:flex; align-items:center; justify-content:center; font-size:56px; font-weight:800; transition: transform .15s; border: 3px solid transparent; }
.profile-tile:hover .avatar-lg { border-color:#fff; transform: scale(1.04); }
.profile-tile .name { color:#999; font-size:18px; }
.profile-tile:hover .name { color:#fff; }

/* Player */
.player-wrap { background:#000; min-height: 100vh; display:flex; flex-direction:column; }
.player-top { padding: 14px 20px; display:flex; align-items:center; gap:14px; }
.player-top a { color:#fff; }
.player-stage { flex:1; display:flex; align-items:center; justify-content:center; }
.player-stage video { width:100%; height: 100%; max-height: calc(100vh - 60px); }

/* Detalhe */
.detail-banner { position:relative; height: 60vh; min-height: 380px; background-size:cover; background-position:center; }
.detail-banner::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, transparent 30%, var(--bg) 100%); }
.detail-content { padding: 0 4% 40px; margin-top: -120px; position: relative; z-index: 2; max-width: 900px; }
.detail-content h1 { font-size: clamp(28px, 4vw, 52px); font-weight:800; margin-bottom: 14px; }
.meta { display:flex; gap:14px; align-items:center; color: var(--text-mute); font-size:14px; margin-bottom: 14px; }
.tag { display:inline-block; padding: 2px 8px; background: rgba(255,255,255,.12); border-radius: 3px; font-size: 12px; }
.stars { display:inline-flex; gap:4px; }
.star { font-size: 22px; cursor: pointer; color: #555; }
.star.on { color: #f5c518; }

/* Episodes */
.ep-list { margin-top: 30px; }
.ep-row { display:flex; gap:18px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items:center; }
.ep-row .ep-num { font-size:24px; color: var(--text-mute); width: 32px; text-align:center; }
.ep-row .ep-cover { width: 180px; aspect-ratio: 16/9; background:#333 center/cover; border-radius:4px; }
.ep-row .ep-info { flex:1; }
.ep-row .ep-info h3 { font-size: 18px; margin-bottom: 6px; }
.ep-row .ep-info p { color: var(--text-mute); font-size:14px; }

/* Plans */
.plans { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:16px; padding: 30px 4%; }
.plan-card { background: var(--bg-elev); padding: 28px; border-radius: 8px; border: 2px solid transparent; }
.plan-card.featured { border-color: var(--brand); }
.plan-card h3 { font-size: 22px; margin-bottom: 8px; }
.plan-card .price { font-size: 36px; font-weight: 800; color: var(--brand); margin: 12px 0; }
.plan-card ul { list-style:none; margin: 14px 0; }
.plan-card ul li { padding: 6px 0; color: var(--text-mute); }

/* Footer */
.footer { padding: 50px 4%; color: var(--text-mute); font-size: 13px; border-top: 1px solid var(--border); margin-top: 60px; }

/* Admin */
.admin-shell { display:flex; min-height: 100vh; align-items: stretch; }
.admin-side {
    width: 240px; background:#000; padding: 24px 0;
    border-right: 1px solid var(--border);
    position: sticky; top: 0; align-self: flex-start;
    height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.admin-side .logo { padding: 0 24px 24px; color: var(--brand); font-weight: 900; font-size: 22px; }
.admin-side a { display:block; padding: 12px 24px; color:#bbb; font-size:14px; }
.admin-side a:hover, .admin-side a.active { background: var(--bg-elev); color:#fff; }
.admin-main { flex:1; padding: 28px 36px; min-width: 0; min-height: 100vh; overflow-x: hidden; }
.admin-main h1 { font-size: 26px; margin-bottom: 18px; }
.admin-stats { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card { background: var(--bg-elev); padding: 18px; border-radius: 8px; }
.stat-card .label { color: var(--text-mute); font-size: 13px; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 4px; }
table.adm { width: 100%; border-collapse: collapse; background: var(--bg-elev); border-radius: 6px; overflow: hidden; }
table.adm th, table.adm td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table.adm th { background: #000; color: var(--text-mute); font-weight: 600; }
.actions-row { display:flex; gap:8px; }
.toolbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }

/* Landing */
.landing-hero { min-height: 90vh; padding: 100px 4% 40px; background: linear-gradient(rgba(0,0,0,.7),rgba(0,0,0,.85)), url('/assets/img/auth-bg.svg') center/cover; text-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.landing-hero h1 { font-size: clamp(32px, 6vw, 64px); font-weight:900; max-width:900px; margin-bottom:18px; }
.landing-hero p { font-size: clamp(16px, 2vw, 22px); margin-bottom: 24px; max-width: 700px; }

/* Responsive */
@media (max-width: 720px) {
    .nav ul { display:none; }
    .nav input[type=search] { width: 130px; }
    .card { flex-basis: 160px; }
    .auth-card { padding: 30px 24px; }
    .admin-side { width: 70px; }
    .admin-side .logo { font-size: 0; }
    .admin-side .logo::before { content: "N"; font-size: 24px; }
    .admin-side a { font-size: 0; padding: 16px; text-align:center; }
    .admin-side a::first-letter { font-size: 18px; }
}

/* ===== Admin: módulo IPTV / formulários ricos ===== */
.adm-page { max-width: 1100px; }
.adm-page h1 { display:flex; align-items:center; gap:12px; font-size: 26px; }
.adm-page h1 .pill { font-size:11px; padding:3px 10px; background: var(--brand); border-radius:999px; font-weight:700; letter-spacing:.5px; }

.adm-toolbar { display:flex; justify-content:space-between; align-items:center; margin: 18px 0 16px; gap:12px; flex-wrap:wrap; }
.adm-toolbar .left { display:flex; gap:10px; align-items:center; color: var(--text-mute); font-size:13px; }

.alert { padding:12px 16px; border-radius:8px; margin:12px 0; font-size:14px; display:flex; gap:10px; align-items:center; border:1px solid transparent; }
.alert.ok   { background: rgba(46,160,67,.12);  color:#7ee787; border-color: rgba(46,160,67,.3); }
.alert.err  { background: rgba(248,81,73,.12);  color:#ffa198; border-color: rgba(248,81,73,.3); }
.alert.info { background: rgba(56,139,253,.12); color:#79c0ff; border-color: rgba(56,139,253,.3); }
.alert.warn { background: rgba(210,153,34,.12); color:#f0c674; border-color: rgba(210,153,34,.3); }

.btn-sm   { padding: 6px 12px; font-size: 13px; border-radius: 4px; }
.btn-link { background: transparent; color: var(--text-mute); padding: 6px 10px; font-size: 13px; }
.btn-link:hover { color: #fff; }
.btn-danger { background:#3a1010; color:#ff8b8b; border:1px solid rgba(248,81,73,.3); }
.btn-danger:hover { background:#5a1414; }

/* Tabela admin estilizada */
.tbl { width:100%; border-collapse: separate; border-spacing: 0; background: var(--bg-elev); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.3); }
.tbl thead th { background:#0a0a0a; color: var(--text-mute); font-weight:600; font-size:12px; letter-spacing:.5px; text-transform:uppercase; padding: 14px 16px; text-align:left; }
.tbl tbody td { padding: 14px 16px; border-top: 1px solid var(--border); font-size:14px; vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(255,255,255,.02); }
.tbl .actions { display:flex; gap:6px; flex-wrap:wrap; }
.tbl .empty { padding: 60px 20px; text-align:center; color: var(--text-mute); }

.badge { display:inline-flex; align-items:center; gap:6px; padding: 3px 10px; border-radius:999px; font-size:11px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; }
.badge.on  { background: rgba(46,160,67,.18);  color:#7ee787; }
.badge.off { background: rgba(255,255,255,.06); color:#999; }
.badge.dot::before { content:"●"; font-size:10px; }

/* Cards / panels */
.panel { background: var(--bg-elev); border-radius: 12px; padding: 24px; border:1px solid var(--border); box-shadow: 0 4px 24px rgba(0,0,0,.25); }
.panel + .panel { margin-top: 18px; }
.panel h2, .panel h3 { display:flex; align-items:center; gap:10px; margin-bottom: 14px; font-size: 17px; }
.panel h3 .ico { font-size: 22px; }
.panel .panel-sub { color: var(--text-mute); font-size:13px; margin: -8px 0 16px; }

.form-grid { display:grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3-1 { grid-template-columns: 3fr 1fr; }
@media (max-width: 700px) { .form-grid.cols-2, .form-grid.cols-3-1 { grid-template-columns: 1fr; } }

.form-row { display:flex; flex-direction:column; gap:6px; }
.form-row label { font-size:12px; color: var(--text-mute); font-weight:600; letter-spacing:.3px; text-transform:uppercase; }
.form-row .hint { color: var(--text-mute); font-size:12px; line-height:1.5; }
.form-row input[type=text], .form-row input[type=url], .form-row input[type=number],
.form-row input[type=password], .form-row input[type=email], .form-row select, .form-row textarea,
.form-row input:not([type]) {
    background:#0d0d0d; color:#fff; border:1px solid #333; border-radius:6px;
    padding: 10px 12px; font-size:14px; transition: border-color .15s, background .15s;
    width:100%;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--brand); background:#101010;
}

.divider { height:1px; background: var(--border); margin: 22px 0; border:0; }

.check { display:flex; align-items:center; gap:10px; cursor:pointer; padding:10px 12px; background:#0d0d0d; border:1px solid #333; border-radius:6px; }
.check input { width:auto; }
.check.lg { font-size:15px; font-weight:600; }

.actions-bar { display:flex; gap:10px; margin-top: 20px; padding-top: 20px; border-top:1px solid var(--border); }

/* Stats grid (import page) */
.stat-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:14px; margin: 8px 0 20px; }
.stat-tile { background:#0d0d0d; border:1px solid var(--border); border-radius:10px; padding:18px; }
.stat-tile .ico { font-size:28px; }
.stat-tile .lbl { color: var(--text-mute); font-size:12px; text-transform:uppercase; letter-spacing:.4px; margin-top:6px; }
.stat-tile .val { font-size:28px; font-weight:800; margin-top:2px; }

code.kbd { background:#0a0a0a; border:1px solid #333; padding: 2px 6px; border-radius:4px; font-size:12px; color:#79c0ff; }

/* ===== Settings page (modern tabs + preview boxes) ===== */
.settings-tabs {
    display:flex; gap:4px; margin: 18px 0 22px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto; flex-wrap: nowrap;
    scrollbar-width: thin;
}
.settings-tabs::-webkit-scrollbar { height:4px; }
.settings-tabs::-webkit-scrollbar-thumb { background:#333; border-radius:2px; }
.settings-tab {
    display:inline-flex; align-items:center; gap:8px;
    padding: 12px 18px; color: var(--text-mute); font-size:14px; font-weight:500;
    white-space: nowrap; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s, background .15s;
    border-radius: 6px 6px 0 0;
}
.settings-tab .ico { font-size:16px; }
.settings-tab:hover { color:#fff; background: rgba(255,255,255,.03); }
.settings-tab.active {
    color:#fff; border-bottom-color: var(--brand);
    background: linear-gradient(180deg, rgba(229,9,20,.06), transparent);
}

.settings-form { max-width: 920px; }

.preview-box {
    position: relative;
    background: repeating-conic-gradient(#0a0a0a 0% 25%, #111 0% 50%) 50%/20px 20px;
    padding: 18px; border-radius: 8px; border:1px solid var(--border);
    margin-bottom: 16px; text-align:center;
}
.preview-box img { max-height: 80px; max-width: 240px; margin:0 auto; }
.preview-box.small img { max-height: 40px; max-width: 40px; }
.preview-box .preview-tag {
    position:absolute; top:8px; left:10px;
    background: rgba(0,0,0,.7); color: var(--text-mute);
    font-size: 10px; padding: 2px 8px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .5px;
}

.form-row input[type=file] {
    background:#0d0d0d; padding: 8px; cursor: pointer;
}
.form-row input[type=color] {
    border:1px solid #333; border-radius:6px; background:#0d0d0d;
}
