* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, 0.24), transparent 30%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.16), transparent 34%),
        linear-gradient(135deg, #050505, #111827);
    color: #f9fafb;
    min-height: 100vh;
}

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

.page {
    width: min(1160px, 92%);
    margin: 0 auto;
    padding: 22px 0 34px;
}

/* ================================
   Top navigation
   ================================ */

.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0 22px;
}

.topnav a {
    color: #f9fafb;
    text-decoration: none;
    margin-left: 14px;
    font-weight: bold;
    font-size: 14px;
}

.topnav .brand,
.brand {
    margin-left: 0;
    font-size: 18px;
    letter-spacing: -0.4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-button {
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
}

/* ================================
   Hero base
   ================================ */

.hero {
    min-height: 42vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px 0 30px;
}

.hero.compact {
    min-height: auto;
    padding: 28px 0;
}

.badge {
    display: inline-block;
    width: fit-content;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    color: #d1d5db;
    font-size: 14px;
    margin-bottom: 18px;
    background: rgba(255,255,255,0.06);
}

h1 {
    font-size: clamp(38px, 7vw, 74px);
    margin: 0;
    letter-spacing: -3px;
    line-height: 0.98;
}

.hero p {
    max-width: 720px;
    color: #d1d5db;
    font-size: 19px;
    line-height: 1.6;
    margin-top: 22px;
}

/* ================================
   Buttons
   ================================ */

.actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: bold;
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.94;
}

.btn.primary {
    background: #e50914;
    color: white;
}

.btn.secondary {
    background: rgba(255,255,255,0.10);
    color: white;
    border: 1px solid rgba(255,255,255,0.18);
}

.btn.full {
    width: 100%;
    border: 0;
    margin-top: 22px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
}

/* ================================
   Grid / Cards base
   ================================ */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.user-grid {
    margin-top: 10px;
}

.card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(12px);
    min-height: 185px;
}

.card.highlight {
    background: rgba(255,255,255,0.11);
}

.card h2 {
    margin-top: 0;
    font-size: 23px;
}

.card p,
.card li {
    color: #d1d5db;
    line-height: 1.55;
}

.card-link {
    display: inline-block;
    margin-top: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 2px solid #e50914;
    padding-bottom: 4px;
}

.card a {
    color: #fff;
}

.small {
    font-size: 14px;
    color: #9ca3af;
}

/* ================================
   Auth pages
   ================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
}

.auth-card {
    width: min(460px, 100%);
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 22px;
    padding: 30px;
    backdrop-filter: blur(12px);
}

.auth-card h1 {
    font-size: 42px;
    letter-spacing: -1px;
    margin-top: 14px;
}

.auth-card label {
    display: block;
    margin: 16px 0 7px;
    color: #d1d5db;
    font-weight: bold;
}

.auth-card input,
.auth-card textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.28);
    color: #fff;
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
}

.auth-card input:focus,
.auth-card textarea:focus {
    border-color: rgba(229, 9, 20, 0.75);
}

.auth-card a {
    color: #fff;
}

.back-link {
    color: #d1d5db;
    text-decoration: none;
}

/* ================================
   Alerts
   ================================ */

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 18px 0;
}

.alert.error {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.alert.success {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

/* ================================
   Admin / Tables
   ================================ */

.large-card {
    margin-top: 30px;
    min-height: auto;
}

.admin-section {
    margin-bottom: 22px;
    min-height: auto;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #f9fafb;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    vertical-align: top;
}

th {
    color: #d1d5db;
    font-size: 14px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mini-btn {
    border: 0;
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: bold;
}

.mini-btn.warning {
    background: rgba(245, 158, 11, 0.28);
}

.mini-btn.danger {
    background: rgba(239, 68, 68, 0.28);
}

.status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: rgba(255,255,255,0.12);
}

.status-active,
.status-approved {
    background: rgba(34, 197, 94, 0.20);
    color: #bbf7d0;
}

.status-pending {
    background: rgba(245, 158, 11, 0.20);
    color: #fde68a;
}

.status-blocked,
.status-rejected {
    background: rgba(239, 68, 68, 0.20);
    color: #fecaca;
}

/* ================================
   Homepage pública leve
   ================================ */

.home-page {
    padding-bottom: 55px;
}

.movie-section {
    margin-top: 34px;
}

.movie-section-main {
    margin-top: 38px;
}

.movie-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 26px;
}

.movie-section-head h2,
.home-title {
    margin: 6px 0 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: -2px;
    max-width: 800px;
}

.movie-section-head p {
    max-width: 390px;
    color: #d1d5db;
    line-height: 1.5;
    margin: 0;
    font-size: 15px;
}

.section-label {
    display: inline-block;
    color: #fca5a5;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ================================
   TMDB Cards
   ================================ */

.tmdb-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.tmdb-card {
    overflow: hidden;
    min-height: 430px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tmdb-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.105);
}

.tmdb-poster {
    position: relative;
    height: 260px;
    background: rgba(255,255,255,0.08);
}

.tmdb-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.poster-fallback {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    background:
        linear-gradient(145deg, rgba(229, 9, 20, 0.35), rgba(37, 99, 235, 0.22)),
        rgba(255,255,255,0.08);
}

.tmdb-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(0,0,0,0.62);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.tmdb-info {
    padding: 15px;
}

.tmdb-info h3 {
    margin: 0 0 9px;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.4px;
}

.tmdb-meta {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}

.tmdb-meta span {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    color: #d1d5db;
    font-size: 12px;
    font-weight: bold;
}

.tmdb-actors {
    color: #f3f4f6;
    font-size: 13px;
    line-height: 1.35;
    margin: 0 0 8px;
}

.tmdb-overview {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    color: #d1d5db;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.tmdb-credit {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.5;
    margin: 16px 0 0;
}

.tmdb-empty {
    padding: 28px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.tmdb-empty h3 {
    margin: 0 0 8px;
}

.tmdb-empty p {
    margin: 0;
    color: #d1d5db;
}

.home-simple-grid {
    margin-top: 38px;
}

/* ================================
   Dashboard privado
   ================================ */

.dashboard-page {
    padding-bottom: 60px;
}

.private-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: end;
    padding: 42px 0 24px;
}

.private-hero h1 {
    font-size: clamp(38px, 5vw, 62px);
    line-height: 1;
    letter-spacing: -2px;
    margin: 0;
}

.private-hero p {
    max-width: 680px;
    color: #d1d5db;
    font-size: 18px;
    line-height: 1.6;
    margin: 18px 0 0;
}

.private-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 4px;
}

.dashboard-card {
    position: relative;
    min-height: 160px;
    overflow: hidden;
    padding: 24px;
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
}

.dashboard-card::after {
    content: "";
    position: absolute;
    right: -52px;
    top: -52px;
    width: 135px;
    height: 135px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.12);
}

.dashboard-card.admin-card {
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.18), rgba(255,255,255,0.08)),
        rgba(255,255,255,0.08);
}

.dashboard-icon {
    position: relative;
    z-index: 2;
    font-size: 28px;
    margin-bottom: 8px;
}

.dashboard-card h2,
.dashboard-card p,
.dashboard-card a {
    position: relative;
    z-index: 2;
}

.dashboard-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
    letter-spacing: -0.5px;
}

.dashboard-card p {
    color: #d1d5db;
    line-height: 1.55;
    margin-bottom: 0;
}

.dashboard-movies {
    margin-top: 48px;
}

.dashboard-movies .movie-section-head h2 {
    font-size: clamp(28px, 4vw, 42px);
}

.dashboard-tmdb-row .tmdb-card {
    min-height: 410px;
}

.dashboard-tmdb-row .tmdb-poster {
    height: 245px;
}

/* ================================
   Responsivo
   ================================ */

@media (max-width: 1150px) {
    .tmdb-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .private-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .private-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 950px) {
    .movie-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .tmdb-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .grid,
    .dashboard-info-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 30px;
    }

    h1 {
        letter-spacing: -2px;
    }

    .topnav {
        align-items: flex-start;
        flex-direction: column;
    }

    .topnav a {
        margin-left: 0;
        margin-right: 12px;
    }

    .movie-section-main {
        margin-top: 24px;
    }

    .movie-section-head h2,
    .home-title {
        font-size: clamp(32px, 9vw, 46px);
        letter-spacing: -1.5px;
    }
}

@media (max-width: 700px) {
    .tmdb-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tmdb-poster {
        height: 230px;
    }

    .hero p {
        font-size: 18px;
    }

    .private-hero {
        padding: 32px 0 24px;
    }

    .private-actions .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 460px) {
    .page {
        width: min(100% - 28px, 1120px);
        padding-top: 20px;
    }

    .topnav {
        gap: 12px;
    }

    .topnav div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topnav a {
        margin-left: 0;
        margin-right: 0;
    }

    .tmdb-row {
        grid-template-columns: 1fr;
    }

    .tmdb-poster {
        height: 310px;
    }

    .actions {
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .auth-card {
        padding: 24px;
    }
}
