* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0b1020;
    --bg-soft: rgba(255, 255, 255, 0.06);
    --card: rgba(15, 23, 42, 0.72);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --primary: #7c3aed;
    --primary-2: #06b6d4;
    --danger: #ef4444;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.22), transparent 30%),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.18), transparent 30%),
        linear-gradient(135deg, #020617 0%, #0b1020 45%, #111827 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.page-content {
    padding: 42px 0 60px;
}

.bg-glow {
    position: fixed;
    width: 340px;
    height: 340px;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.22;
    pointer-events: none;
}

.bg-glow-1 {
    top: -80px;
    left: -80px;
    background: #7c3aed;
}

.bg-glow-2 {
    bottom: -120px;
    right: -100px;
    background: #06b6d4;
}

/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(2, 6, 23, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 14px;
}

.logo {
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    padding: 10px 14px;
    border-radius: 999px;
    transition: 0.25s ease;
}

.nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: #111827 !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0 !important;
    font-size: 16px;
}

.nav-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 430px;
    margin: 0 24px;
}

.nav-search-form input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.07);
    color: white;
    outline: none;
}

.nav-search-form input::placeholder {
    color: #94a3b8;
}

.nav-search-form button {
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    color: white;
}

/* BASE CARDS */

.hero-card,
.movie-card,
.poster-card,
.section-card,
.favorite-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.section-card {
    border-radius: var(--radius-xl);
    padding: 28px;
}

/* BADGES + BUTTONS */

.badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.22), rgba(6, 182, 212, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e9d5ff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 16px;
}

.small-badge {
    width: fit-content;
    font-size: 0.68rem;
    padding: 6px 10px;
    margin-bottom: 0;
}

.search-form button,
.primary-btn,
.secondary-btn,
.danger-btn {
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-block;
}

.search-form button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.search-form button,
.primary-btn {
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    color: white;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.09);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.danger-btn {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.26);
}

/* FLASH */

.flash-wrapper {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.flash-message {
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.22);
    color: white;
}

/* AUTH */

.auth-wrapper {
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
}

.auth-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.auth-card h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.auth-card p {
    color: #cbd5e1;
    margin-bottom: 18px;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.auth-form input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 1rem;
    outline: none;
}

.auth-form input::placeholder {
    color: #94a3b8;
}

.auth-form button {
    width: 100%;
    margin-top: 6px;
}

.auth-link {
    margin-top: 18px;
}

.auth-link a {
    color: #60a5fa;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ACCOUNT */

.account-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.account-header-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    border-radius: var(--radius-xl);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.account-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    color: white;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-header-info h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.account-header-info p {
    color: var(--muted);
    margin: 0;
}

.account-grid {
    display: grid;
    gap: 20px;
}

.account-section {
    border-radius: var(--radius-xl);
    padding: 28px;
}

.account-section h2 {
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.account-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.account-actions form {
    margin: 0;
}

.recent-searches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.recent-search-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.recent-search-item span {
    font-weight: 600;
    color: white;
}

.recent-search-item small {
    color: var(--muted);
    white-space: nowrap;
}

.account-empty-text {
    color: var(--muted);
    margin-top: 12px;
}

/* HERO */

.hero-slider {
    position: relative;
    margin-bottom: 28px;
}

.hero-banner {
    position: relative;
    min-height: 500px;
    border-radius: 30px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 48px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    filter: saturate(1.1) contrast(1.05);
}

.hero-slide {
    display: none;
    animation: heroFade 0.7s ease;
}

.hero-slide.active {
    display: flex;
}

.hero-media-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-media-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(2, 6, 23, 0.65) 0%,
        rgba(2, 6, 23, 0.35) 45%,
        rgba(2, 6, 23, 0.70) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.hero-backdrop-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(2, 6, 23, 0.70) 0%,
        rgba(2, 6, 23, 0.30) 40%,
        rgba(2, 6, 23, 0.65) 100%
    );
    z-index: 2;
}

.hero-trailer-frame {
    position: absolute;
    inset: 0;
    width: 140%;
    height: 140%;
    left: -20%;
    top: -20%;
    border: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.hero-banner.is-playing .hero-trailer-frame {
    opacity: 1;
}

.hero-banner-content {
    position: relative;
    z-index: 3;
    max-width: 760px;
}

.hero-banner-content h1 {
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    margin-bottom: 14px;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.hero-banner-content p {
    color: #dbe4f0;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 22px;
    max-width: 760px;
}

.hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hero-meta span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5edf7;
    font-size: 0.92rem;
    font-weight: 600;
}

.hero-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-main-btn {
    padding: 15px 26px;
    font-size: 1rem;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    cursor: pointer;
    z-index: 10;
}

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

.hero-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.hero-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
}

.hero-dot.active {
    background: white;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* MOVIE DETAIL */

.movie-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.poster-card {
    border-radius: var(--radius-xl);
    padding: 16px;
    min-height: 100%;
}

.poster-image,
.favorite-poster {
    width: 100%;
    display: block;
    border-radius: 20px;
    object-fit: cover;
}

.poster-placeholder {
    min-height: 480px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 20px;
}

.poster-placeholder.small {
    min-height: 220px;
}

.movie-card {
    border-radius: var(--radius-xl);
    padding: 28px;
}

.movie-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.movie-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 8px;
}

.movie-subtitle {
    color: var(--muted);
    font-size: 1rem;
}

.rating-box {
    min-width: 110px;
    text-align: center;
    border-radius: 22px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.rating-box span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.rating-box strong {
    font-size: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.info-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 16px;
}

.info-item span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.info-item strong {
    font-size: 1rem;
    line-height: 1.5;
}

.plot-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 22px;
    padding: 20px;
    margin-bottom: 20px;
}

.plot-box h3 {
    margin-bottom: 10px;
}

.plot-box p {
    color: var(--muted);
    line-height: 1.75;
}

.favorite-form {
    margin: 0;
}

.result-action-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.inline-watch-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0;
}

.inline-selectors {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-selectors select {
    min-width: 110px;
    max-width: 260px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    outline: none;
    font-size: 0.95rem;
}

.inline-selectors select option {
    background: #0f172a;
    color: white;
}

/* TRAILER + PROVIDERS */

.trailer-section .section-card,
.favorites-header .section-card,
.empty-state {
    border-radius: var(--radius-xl);
    padding: 28px;
}

.trailer-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin: 18px 0;
    border-radius: 20px;
    overflow: hidden;
}

.trailer-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.trailer-title {
    color: var(--muted);
    margin-bottom: 18px;
}

.provider-list {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.provider-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.provider-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

/* FAVORITES */

.favorites-grid {
    display: grid;
    gap: 20px;
    margin-top: 22px;
}

.favorite-card {
    border-radius: var(--radius-xl);
    padding: 18px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: stretch;
}

.favorite-poster-wrap {
    height: 100%;
}

.favorite-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favorite-content h2 {
    font-size: 1.8rem;
}

.favorite-meta {
    color: var(--muted);
}

.favorite-plot {
    color: var(--muted);
    line-height: 1.7;
}

.favorite-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
}

/* COMPACT GRID */

.compact-grid-section {
    margin-top: 12px;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.compact-card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    display: flex;
    flex-direction: column;
}

.compact-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
}

.compact-poster-wrap {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.compact-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.compact-card:hover .compact-poster {
    transform: scale(1.08);
}

.compact-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.compact-content h3 {
    font-size: 1rem;
    line-height: 1.35;
}

.compact-year {
    color: var(--muted);
    font-size: 0.92rem;
}

.compact-actions {
    margin-top: auto;
}

.compact-btn {
    width: 100%;
    text-align: center;
    padding: 11px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
}

.compact-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
}

/* CONTINUE WATCHING */

.continue-section {
    margin: 24px 0 30px;
    padding: 22px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.22), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.continue-header {
    margin-bottom: 18px;
}

.continue-header h2 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.continue-header p {
    color: var(--muted);
    margin: 0;
}

.continue-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-behavior: smooth;
}

.continue-row::-webkit-scrollbar {
    height: 10px;
}

.continue-row::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
}

.continue-row::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.continue-card {
    flex: 0 0 260px;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.continue-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.continue-poster-wrap {
    height: 150px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.continue-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.continue-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    padding: 16px;
}

.continue-content {
    padding: 14px;
}

.continue-top-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.continue-episode-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
}

.continue-content h3 {
    font-size: 1rem;
    line-height: 1.35;
    margin-bottom: 12px;
    min-height: 44px;
}

.continue-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.continue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    border-radius: 999px;
}

.continue-actions {
    display: flex;
    gap: 10px;
}

.continue-btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.92rem;
}

/* PLAYER */

.player-page {
    margin: 20px 0 30px;
    width: 100%;
    height: 100%;
}

.player-card {
    padding: 24px;
    border-radius: 28px;
}

.player-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.player-top h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-top: 8px;
    margin-bottom: 8px;
}

.player-subtitle {
    color: var(--muted);
}

.player-top-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.player-frame-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    padding-top: 56.25%;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.player-frame-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* FOOTER */

.site-footer {
    margin-top: 40px;
    padding: 28px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.footer-copy {
    color: var(--muted);
    margin-top: 8px;
    max-width: 420px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: white;
}

/* PROFILI UTENTE */

.account-avatar-link {
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.nav-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.mobile-profile-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.mobile-profile-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.mobile-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-profile-meta strong {
    color: white;
    font-size: 0.96rem;
}

.mobile-profile-meta span {
    color: var(--muted);
    font-size: 0.82rem;
}

/* PAGINA PROFILI */

.profiles-page {
    min-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 28px 0 48px;
}

.profiles-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    margin-bottom: 12px;
    text-align: center;
}

.profiles-subtitle {
    color: var(--muted);
    text-align: center;
    margin-bottom: 26px;
    font-size: 1rem;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 26px;
    width: min(900px, 100%);
    margin-top: 20px;
}

.profile-card {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.profile-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.18);
}

.profile-card:focus {
    outline: none;
    transform: scale(1.04);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.45), 0 24px 54px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
}

.profile-avatar-wrapper {
    width: 132px;
    height: 132px;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 28px;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.profile-name {
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
}

.profile-add .add-avatar {
    font-size: 3rem;
    font-weight: 300;
    color: white;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(6, 182, 212, 0.25));
}

/* NUOVO PROFILO */

.new-profile-page {
    align-items: center;
}

.new-profile-card {
    width: min(760px, 100%);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.new-profile-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-weight: 700;
    color: white;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    outline: none;
    font-size: 1rem;
}

.form-group input[type="text"]::placeholder {
    color: #94a3b8;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 14px;
}

.avatar-option {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: 22px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.avatar-choice-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 18px;
}

.avatar-option:hover {
    transform: translateY(-3px);
}

.avatar-option:focus-within {
    border-color: rgba(124, 58, 237, 0.7);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.avatar-option input:checked + .avatar-choice-image {
    outline: 3px solid rgba(6, 182, 212, 0.9);
    outline-offset: 2px;
}

.new-profile-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* COMPACT RAIL */

.compact-rail-section {
    margin-top: 12px;
    margin-bottom: 24px;
}

.compact-rail {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 6px 4px 10px;
}

.compact-rail::-webkit-scrollbar {
    height: 10px;
}

.compact-rail::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
}

.compact-rail::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
}

.compact-rail .compact-card {
    flex: 0 0 240px;
}

/* TV FOCUS */

.tv-focusable {
    outline: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tv-focusable:focus {
    transform: scale(1.04);
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.45), 0 20px 44px rgba(0,0,0,0.38);
    z-index: 5;
}

.tv-focusable:focus .compact-poster,
.tv-focusable:focus .continue-poster {
    transform: scale(1.05);
}

/* SIDEBAR + TOPBAR */

.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 76px;
    height: 100vh;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 10px;
    z-index: 60;
    transition: width 0.25s ease;
    overflow: hidden;
}

.side-nav:hover {
    width: 230px;
}

.side-nav-top {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.side-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px;
    border-radius: 14px;
    text-decoration: none;
    color: white;
    overflow: hidden;
}

.side-profile:hover {
    background: rgba(255, 255, 255, 0.06);
}

.side-profile-avatar-wrap {
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex-shrink: 0;
}

.side-profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.side-profile-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    color: white;
    font-weight: 700;
}

.side-nav-links,
.side-nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: #cbd5e1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.side-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.side-nav-icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.side-nav-label {
    opacity: 0;
    width: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, max-width 0.25s ease;
    font-weight: 600;
}

.side-nav:hover .side-nav-label {
    opacity: 1;
    width: auto;
    max-width: 160px;
}

.side-nav-link.tv-focusable:focus {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.35);
}

.page-with-sidebar {
    margin-left: 76px;
}

.top-header-clean {
    backdrop-filter: blur(14px);
    background: rgba(2, 6, 23, 0.45);
}

.topbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.topbar-wrapper.with-sidebar {
    padding-left: 8px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-home-link {
    text-decoration: none;
    color: #cbd5e1;
    padding: 8px 12px;
    border-radius: 12px;
    transition: 0.2s ease;
}

.top-home-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.topbar-search {
    max-width: 460px;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.desktop-search-visible,
.desktop-auth-visible {
    display: flex;
}

.mobile-nav,
.mobile-search-panel,
.mobile-dropdown-menu,
.mobile-only-nav {
    display: none;
}

.mobile-nav {
    align-items: center;
    gap: 10px;
}

.mobile-home-link {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-toggle,
.mobile-search-toggle {
    border: none;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.mobile-search-panel.open,
.mobile-dropdown-menu.open {
    display: block;
}

.mobile-search-panel {
    margin-top: 14px;
}

.mobile-search-form {
    width: 100%;
    display: flex;
    gap: 10px;
}

.mobile-search-form input {
    flex: 1;
    min-width: 0;
}

.mobile-dropdown-menu {
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(8, 12, 35, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.mobile-dropdown-menu a {
    display: block;
    text-decoration: none;
    color: #fff;
    padding: 12px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.mobile-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* RESPONSIVE */

@media (max-width: 1100px) {
    .compact-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nav-wrapper {
        flex-wrap: wrap;
    }

    .nav-search-form {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 900px) {
    .movie-layout {
        grid-template-columns: 1fr;
    }

    .favorite-card {
        grid-template-columns: 1fr;
    }

    .movie-header {
        flex-direction: column;
    }

    .side-nav {
        display: none;
    }

    .page-with-sidebar {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .desktop-search-visible,
    .desktop-auth-visible,
    .top-home-link {
        display: none !important;
    }

    .mobile-only-nav,
    .mobile-nav {
        display: block;
    }

    .mobile-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 12px;
        margin-bottom: 4px;
    }

    .topbar-wrapper {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .topbar-left {
        width: 100%;
        justify-content: space-between;
    }

    .logo {
        font-size: 1.8rem;
    }

    .profiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .profile-avatar-wrapper {
        width: 110px;
        height: 110px;
    }

    .new-profile-card {
        padding: 22px;
    }

    .compact-rail .compact-card {
        flex: 0 0 190px;
    }

    .compact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-banner {
        padding: 26px;
        min-height: 380px;
    }

    .hero-banner-content h1 {
        font-size: 2.2rem;
    }

    .hero-banner-content p {
        font-size: 0.96rem;
    }

    .result-action-row {
        align-items: stretch;
    }

    .favorite-form,
    .inline-watch-form {
        width: 100%;
    }

    .inline-watch-form {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .continue-section {
        padding: 16px;
    }

    .continue-card {
        flex: 0 0 220px;
    }

    .continue-poster-wrap {
        height: 130px;
    }
}

@media (max-width: 640px) {
    .hero-card,
    .movie-card,
    .poster-card,
    .section-card,
    .favorite-card {
        padding: 20px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .nav-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .account-header-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .recent-search-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .compact-grid {
        grid-template-columns: 1fr;
    }

    .profiles-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-avatar-wrapper {
        width: 92px;
        height: 92px;
        border-radius: 22px;
    }

    .profile-avatar {
        border-radius: 22px;
    }

    .profile-name {
        font-size: 0.95rem;
    }

    .new-profile-actions {
        flex-direction: column;
    }

    .new-profile-actions .primary-btn,
    .new-profile-actions .secondary-btn {
        width: 100%;
        text-align: center;
    }
}