:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #d946ef;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.78);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.8);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-dark: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body.light-theme .header-logo,
body.light-theme .footer-logo {
    filter: none;
}

body.light-theme .blob {
    opacity: 0.2;
}

body.light-theme .brand {
    color: #1e293b;
}

body.light-theme input[type="text"] {
    color: #1e293b;
    border-color: #e2e8f0;
}

body.light-theme .info-block {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .back-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-theme .back-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

body.light-theme h1 {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


body.light-theme .promo-card {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .promo-btn {
    background: var(--primary);
    color: #ffffff;
}

body.light-theme .promo-btn:hover {
    background: var(--primary-light);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animations
   The blobs use radial gradients instead of a full-screen filter: blur(80px).
   A blurred fixed layer under animated children forces the GPU to re-blur the
   whole viewport every frame; gradients give the same soft look for free. */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    contain: strict;
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.45;
    animation: move 20s infinite alternate;
    will-change: transform;
}

.blob-1 {
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 65%);
    top: -220px;
    left: -220px;
}

.blob-2 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 65%);
    bottom: -300px;
    right: -250px;
    animation-delay: -5s;
}

.blob-3 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
    top: 35%;
    left: 55%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.light-theme header {
    background: rgba(255, 255, 255, 0.9);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.brand {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--text-main);
    text-decoration: none;
}

.highlight {
    color: var(--primary-light);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    width: 44px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.light-theme .theme-toggle {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

body.light-theme .theme-toggle:hover {
    background: #f8fafc;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.sun-icon,
body.light-theme .moon-icon {
    display: none;
}

body.light-theme .sun-icon {
    display: block;
}


.attribution {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.attribution span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.attribution a {
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.attribution a:hover {
    transform: scale(1.05);
}

.header-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

body.light-theme .header-logo {
    filter: none;
}

.footer-logo {
    height: 22px;
    filter: brightness(0) invert(1);
}

body.light-theme .footer-logo {
    filter: none;
}


/* Slider Animation */
#promo-slider {
    transition: opacity 0.5s ease-in-out;
}


.fade-out {
    opacity: 0;
}

.long-info {
    margin-top: 4rem;
    text-align: left;
}

.info-block {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
}

.info-block h2 {
    font-size: 1.5rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.info-block h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.info-block p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Static Pages Styles */
.static-page {
    animation: fadeIn 0.4s ease-out;
}

.static-page h1 {
    margin-bottom: 2rem;
    text-align: left;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--primary);
    transform: translateX(-5px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Generator Card */
/* No backdrop-filter here: blurring a card-sized region every frame while the
   background animates is the single most expensive effect on the page. */
.generator-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.password-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.password-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-left: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.2rem 3.5rem 1.2rem 1.5rem;
    color: white;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

body.light-theme input[type="text"] {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}


.copy-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.copy-success {
    position: absolute;
    right: 4rem;
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    pointer-events: none;
}

.copy-success.show {
    opacity: 1;
    transform: translateY(0);
}

.copy-btn.copied {
    color: var(--primary-light);
}

.main-btn {
    width: 100%;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 12px;
    padding: 1.2rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}

.main-btn:active {
    transform: translateY(0);
}

.language-selector {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.flag {
    width: 24px;
    height: 18px;
    cursor: pointer;
    border-radius: 2px;
    opacity: 0.5;
    transition: var(--transition);
    object-fit: cover;
}

.flag:hover,
.flag.active {
    opacity: 1;
    transform: scale(1.2);
}

/* Banner Section */
.banner-section {
    margin-bottom: 3rem;
}

.promo-card {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
}

.promo-content {
    flex: 1;
}

.promo-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.promo-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.promo-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: white;
    color: var(--bg-dark);
    text-decoration: none;
    font-weight: 700;
    border-radius: 10px;
    transition: var(--transition);
}

.promo-btn:hover {
    background: var(--primary-light);
    color: white;
    transform: translateX(5px);
}

.promo-image {
    width: 240px;
    height: 240px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Animate the wrapper (composited transform) instead of a filtered image */
    animation: float 6s ease-in-out infinite;
    will-change: transform;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* The hero is opaque, so box-shadow looks identical to drop-shadow() and
       doesn't get recomputed on every animation frame. */
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Info Content */
.info-content {
    margin-bottom: 4rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.info-column h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--primary-light);
}

.info-column ul {
    list-style: none;
    margin-top: 1.5rem;
}

.info-column li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-column li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--secondary);
}

/* Footer */
footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--card-border);
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

/* Text, "&" and logos share one vertical centre line */
.footer-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.footer-credit a {
    display: inline-flex;
    align-items: center;
}

.footer-links {
    margin-top: 1.5rem;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    header {
        padding: 1rem 0;
    }

    header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .logo-group {
        align-items: flex-start;
        width: auto;
        gap: 0.4rem;
    }

    .attribution {
        width: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.6rem;
        padding: 0;
        background: transparent;
        border: none;
        text-align: right;
    }

    .attribution span {
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        opacity: 0.6;
        width: 100%;
        /* Forces 'POR' to stay on top line if needed, or row if space allows */
        margin-bottom: -0.2rem;
    }

    .brand {
        font-size: 1.4rem;
    }

    .header-logo {
        height: 18px;
        /* Slightly smaller to fit better in 2 lines */
    }


    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .generator-card {
        padding: 2rem 1.2rem;
        border-radius: 20px;
        margin-top: 1rem;
    }

    h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        text-align: center;
    }

    .subtitle {
        text-align: center;
        font-size: 0.95rem;
    }

    input[type="text"] {
        font-size: 1.1rem !important;
        padding: 1rem 3rem 1rem 1rem !important;
    }
}
/* Respect users who asked for less motion (also saves battery on mobile) */
@media (prefers-reduced-motion: reduce) {
    .blob,
    .promo-image,
    .static-page {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
