:root {
    color-scheme: light dark;
    --bg: #f8fafc;
    --bg-elev: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --success: #10b981;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.16);
    --radius: 16px;
    --radius-lg: 24px;
}

[data-theme='dark'] {
    --bg: #0f172a;
    --bg-elev: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --accent: #22d3ee;
    --accent-hover: #06b6d4;
    --success: #34d399;
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 3rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 3rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0;
}

.brand:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.brand .logo {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand .brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-primary {
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-primary ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-shrink: 0;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn:hover {
    background: var(--bg);
    transform: scale(1.1);
}

.theme-icon {
    display: inline-flex;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
}

.theme-icon.sun-icon {
    opacity: 1;
}

.theme-icon.sun-icon.hidden {
    opacity: 0;
    transform: rotate(-180deg);
    pointer-events: none;
}

.theme-icon.moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

.theme-icon.moon-icon.hidden {
    display: none;
}

[data-theme="light"] .theme-icon.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="light"] .theme-icon.moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon.sun-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

[data-theme="dark"] .theme-icon.moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
    background: var(--bg);
    padding: 0.4rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lang-btn .flag-img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.lang-btn:hover .flag-img {
    transform: scale(1.1);
}

.lang-btn[data-active="true"] {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.lang-btn[data-active="true"] .flag-img {
    filter: brightness(1.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.auth-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg);
}

.button {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elev);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

.button.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.button.primary:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent-hover) 100%);
}

.ghost {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.ghost:hover {
    background: var(--border);
    color: var(--text);
}

.page {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
    margin: 3rem 0 5rem;
    padding: 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 0.2rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--muted);
    margin-bottom: 3.5rem;
    line-height: 1.7;
}

.pricing-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
    color: #1a1a2e;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
    border: 2px solid rgba(139, 92, 246, 0.2);
    animation: pulse 2.5s ease-in-out infinite;
    transition: all 0.3s ease;
}

[data-theme="dark"] .pricing-badge {
    background: linear-gradient(135deg, #2a2a3e, #1f1f2e);
    color: #e0e0e0;
    border: 2px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.35);
}

.pricing-badge .netflix {
    color: #e50914;
    font-weight: 900;
}

[data-theme="dark"] .pricing-badge .netflix {
    color: #ff4444;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(139, 92, 246, 0.25);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 40px rgba(139, 92, 246, 0.35);
    }
}

.hero-mockup {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: float 3s ease-in-out infinite;
}

#theme-image-night,
#theme-image-day {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: filter 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

#theme-image-day {
    display: none;
}

[data-theme="light"] #theme-image-night {
    display: none;
}

[data-theme="light"] #theme-image-day {
    display: block;
}

[data-theme="light"] #theme-image-day {
    filter: brightness(1.1) contrast(1.05);
}

[data-theme="dark"] #theme-image-night {
    filter: brightness(0.95) contrast(1.1);
}

.flag {
    margin-right: 0.25rem;
    font-size: 1.1em;
    display: inline-block;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

.cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-card {
    background: var(--bg-elev);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 1.5rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

.stat {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.feature-card {
    background: var(--bg-elev);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleY(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.feature-card p {
    color: var(--muted);
    line-height: 1.6;
}

.card {
    background: var(--bg-elev);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin: 3rem 0;
    border: 1px solid var(--border);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.card h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.form {
    display: grid;
    gap: 1.75rem;
    margin-top: 2rem;
}

.field {
    display: grid;
    gap: 0.65rem;
}

.field label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
    padding: 0.95rem 1.25rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-elev);
}

.field input::placeholder {
    color: var(--muted);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.role-option {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg);
}

.role-option:hover {
    border-color: var(--primary);
    background: var(--bg-elev);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.role-option input:checked + span {
    font-weight: 600;
    color: var(--primary);
}

.role-section {
    display: none;
    border-left: 3px solid var(--primary);
    padding-left: 1.5rem;
    margin-top: 1.5rem;
    animation: slideIn 0.3s ease;
}

.role-section.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.hint {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    margin: 1.5rem 0;
    background: var(--bg);
    transition: all 0.3s ease;
}

.status:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg);
    transition: all 0.3s ease;
}

.list li:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-card {
    border: 2px solid var(--border);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-elev) 100%);
    transition: all 0.3s ease;
}

.payment-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
}

.payment-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.payment-card p {
    color: var(--muted);
    font-size: 1.125rem;
}

.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 5rem;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .topbar {
        padding: 1rem 1.5rem;
    }

    .header-container {
        gap: 1.5rem;
    }

    .nav-primary {
        display: none;
    }

    .nav-actions {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .controls-group {
        width: 100%;
        justify-content: space-between;
    }

    .auth-group {
        width: 100%;
        gap: 0.5rem;
    }

    .auth-group .button {
        flex: 1;
        min-width: 100px;
    }

    .user-greeting {
        display: none;
    }

    .brand .brand-name {
        display: none;
    }

    .payment-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
    }

    .card {
        padding: 2rem;
    }

    .page {
        padding: 2rem 1rem;
    }
}

/* Header Theme Toggle (3 options) */
.theme-toggle-header {
    display: flex;
    gap: 0.25rem;
    background: var(--bg);
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.theme-toggle-btn {
    background: none;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.theme-toggle-btn:hover {
    opacity: 0.8;
    background: var(--border);
}

.theme-toggle-btn.active {
    background: var(--primary);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
    max-width: 400px;
    min-width: 280px;
}

.toast.success {
    border-left: 4px solid var(--success);
    background: var(--bg-elev);
}

.toast.error {
    border-left: 4px solid #ef4444;
    background: var(--bg-elev);
}

.toast.info {
    border-left: 4px solid var(--primary);
    background: var(--bg-elev);
}

.toast.warning {
    border-left: 4px solid #f59e0b;
    background: var(--bg-elev);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.toast-close:hover {
    background: var(--border);
    color: var(--text);
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}
