/* ============================================================
   FactoryViral — Custom CSS
   Paleta + Dark/Light + Utilidades + Componentes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-deep: #101010;
    --bg-dark: #0c0c0c91;
    --bg-card: #181818;
    --bg-light: #181818;
    --bg-fondo: #333333;
    --border: #353535;
    --text: #F8F8F8;
    --text-muted: #9E9E9E;
    --primary: #30e2a0;
    --accent: #45dc88;
    --secondary: #30e2c9;
    --error: #ef4444;
    --warning: #f59e0b;
}

[data-theme="light"] {
    --bg-deep:    #f4f4f4;
    --bg-dark:    #eaeaea;
    --bg-card:    #ffffff;
    --bg-light:   #eaeaea;
    --border:     #d0d0d0;
    --text:       #111111;
    --text-muted: #777777;
}

/* ── Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

::selection { background: rgba(92, 213, 207, 0.3); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ── Layout utilities ── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.inline-flex   { display: inline-flex; }
.inline-block  { display: inline-block; }
.block         { display: block; }
.hidden        { display: none; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1    { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2    { gap: 0.5rem; }
.gap-3    { gap: 0.75rem; }
.gap-4    { gap: 1rem; }
.gap-5    { gap: 1.25rem; }
.gap-6    { gap: 1.5rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.top-0    { top: 0; }
.top-full { top: 100%; }
.right-0  { right: 0; }
.right-6  { right: 1.5rem; }
.bottom-6 { bottom: 1.5rem; }
.z-30     { z-index: 30; }
.z-50     { z-index: 50; }

/* ── Sizing ── */
.w-full    { width: 100%; }
.w-4      { width: 1rem; }
.w-56     { width: 14rem; }
.h-4      { height: 1rem; }
.max-w-sm  { max-width: 24rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-6xl { max-width: 72rem; }
.min-h-screen { min-height: 100vh; }
.min-w-0  { min-width: 0; }

/* ── Spacing ── */
.p-4   { padding: 1rem; }
.p-6   { padding: 1.5rem; }
.px-2  { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3  { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4  { padding-left: 1rem; padding-right: 1rem; }
.px-5  { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6  { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8  { padding-left: 2rem; padding-right: 2rem; }
.py-1  { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2  { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3  { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4  { padding-top: 1rem; padding-bottom: 1rem; }
.py-6  { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8  { padding-top: 2rem; padding-bottom: 2rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-4  { padding-top: 1rem; }
.pr-4  { padding-right: 1rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-auto { margin-top: auto; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 0.25rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-5  { margin-bottom: 1.25rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ── Typography ── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-base   { font-size: 1rem; line-height: 1.5rem; }
.text-2xl    { font-size: 2.5rem; color: var(--primary); }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-underline { text-decoration: none; }

/* ── Borders & Radius ── */
.rounded      { border-radius: 0.25rem; }
.rounded-lg   { border-radius: 0.5rem; }
.rounded-xl   { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.border-t     { border-top-width: 1px; border-top-style: solid; }
.border-2     { border-width: 2px; border-style: solid; }

/* ── Transitions ── */
.transition-all    { transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4,0,0.2,1); }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4,0,0.2,1); }
.transition-transform { transition-property: transform; transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* ── Transforms ── */
.rotate-180 { transform: rotate(180deg); }
.scale-95   { transform: scale(0.95); }
.scale-100  { transform: scale(1); }

/* ── Opacity ── */
.opacity-0   { opacity: 0; }
.opacity-100 { opacity: 1; }

/* ── Misc ── */
.overflow-hidden { overflow: hidden; }
.accent-primary  { accent-color: var(--primary); }

/* ── Hover states ── */
.hover\:text-white:hover { color: #fff; }
.hover\:underline:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
}

/* ── Font sizes (px) ── */
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-15 { font-size: 15px; }
.fs-17 { font-size: 17px; }
.fs-20 { font-size: 20px; }
.fs-24 { font-size: 24px; }
.fs-28 { font-size: 28px; }

/* ── Color utilities ── */
.c-text       { color: var(--text); }
.c-muted      { color: var(--text-muted); }
.c-primary    { color: var(--primary); }
.c-secondary  { color: var(--secondary); }
.c-accent     { color: var(--accent); }
.c-error      { color: var(--error); }
.c-warning    { color: var(--warning); }
.c-white      { color: #fff; }
.c-black      { color: #090909; }
.c-logout     { color: #e55; }

/* ── Background utilities ── */
.bg-deep   { background-color: var(--bg-deep); }
.bg-dark   { background-color: var(--bg-dark); }
.bg-card   { background-color: var(--bg-card); }
.bg-light  { background-color: var(--bg-light); }

/* ── Border utilities ── */
.border-theme { border-color: #e5e7eb24; }

/* ── Line height ── */
.lh-relaxed { line-height: 1.7; }

/* ── Buttons ── */

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #090909;
    font-weight: 700;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(92, 213, 207, 0.2);
}
.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(92, 213, 207, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 10px rgba(92, 213, 207, 0.2);
}
.btn-primary.htmx-request {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}
.htmx-request .htmx-indicator-hide { display: none; }
.htmx-request .htmx-indicator-show { display: inline !important; }
.btn-primary:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-ghost {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--text);
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: var(--error);
    font-size: 13px;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ── Cards ── */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: #555; }
.card-clickable:hover { transform: translateY(-1px); cursor: pointer; }

/* ── Section (content cards for pages) ── */
.section {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}
.section-danger {
    background-color: var(--bg-card);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
}

/* ── Page layout ── */
.page-wide    { max-width: 72rem; margin: 0 auto; padding: 1.5rem 2rem; }
.page-medium  { max-width: 56rem; margin: 0 auto; padding: 3rem 2rem; }
.page-narrow  { max-width: 42rem; margin: 0 auto; padding: 3rem 2rem; }

/* ── Navbar glass ── */
.navbar-glass {
    background-color: rgba(9, 9, 9, 0.93);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(53, 53, 53, 0.4);
}
[data-theme="light"] .navbar-glass {
    background-color: rgba(244, 244, 244, 0.93);
    border-bottom-color: rgba(208, 208, 208, 0.6);
}

/* ── Nav link ── */
.nav-tabs-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-pill {
    position: absolute;
    background: #30e2a0;
    border-radius: 0.5rem;
    pointer-events: none;
    opacity: 0;
    z-index: 0;
}
.nav-link {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active {
    color: #0c0c0c;
    background: transparent;
}

/* ── Logo icon ── */
.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
.logo-icon svg { width: 19px; height: 19px; fill: #090909; }

.logo-icon-lg { width: 48px; height: 48px; border-radius: 12px; }
.logo-icon-lg svg { width: 24px; height: 24px; }

.logo-text {
    font-size: 32px;
    font-weight: 900;
    color: var(--text);
    font-family: system-ui;
}

/* ── Credits badge (navbar) ── */
.credits-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: var(--border);
    font-size: 13px;
}
.credits-green  { color: var(--accent); }
.credits-yellow { color: var(--warning); }
.credits-red    { color: var(--error); }
.credits-value  { color: var(--text); font-weight: 600; }

/* ── Avatar ── */
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #090909;
}
.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 24px;
}
.avatar-placeholder {
    background: var(--bg-light);
    border: 2px solid var(--border);
    color: var(--text-muted);
}

/* ── Dropdown ── */
.dropdown {
    background: var(--bg-light);
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    border-radius: 0.75rem;
    overflow: hidden;
}
.dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.dropdown-row {
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    justify-content: between;
    border-bottom: 1px solid var(--border);
}
.dropdown-item {
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background-color 0.15s;
    text-decoration: none;
}
.dropdown-item:hover { background-color: var(--bg-dark); }
.dropdown-divider { border-top: 1px solid var(--border); }

.buy-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: rgba(92, 213, 207, 0.13);
    color: var(--primary);
    text-decoration: none;
}

/* ── Form inputs ── */
.form-input {
    background-color: var(--bg-dark);
    border: 2px solid var(--border);
    color: var(--text);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 13px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-input:focus { border-color: var(--primary); }
.form-input.form-input-valid { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input {
    color-scheme: dark;
    cursor: pointer;
}
select.form-input option {
    background-color: var(--bg-card);
    color: var(--text);
}
[data-theme="light"] select.form-input { color-scheme: light; }

.form-input-sm {
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 13px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-input-sm:focus { border-color: var(--primary); }
.form-input-sm::placeholder { color: var(--text-muted); }
.form-input-sm:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

select.form-input-sm {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239E9E9E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
    cursor: pointer;
}
select.form-input-sm option {
    background-color: var(--bg-card);
    color: var(--text);
}

.form-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ── Flash messages ── */
.flash-success { background: rgba(69, 220, 136, 0.15); border: 1px solid rgba(69, 220, 136, 0.3); color: var(--accent); font-size: 13px; }
.flash-error   { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--error); font-size: 13px; }
.flash-info    { background: rgba(92, 213, 207, 0.15); border: 1px solid rgba(92, 213, 207, 0.3); color: var(--primary); font-size: 13px; }

/* ── Progress bar ── */
.progress-bar {
    height: 4px;
    border-radius: 2px;
    background-color: var(--border);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.7s ease;
}

/* ── Status badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--bg-dark);
}

/* ── Animations ── */
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.animate-pulse-soft { animation: pulse-soft 1.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Theme toggle ── */
.theme-toggle {
    position: relative;
    width: 3rem;
    height: 1.5rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.3s;
    background-color: var(--border);
    border: none;
    padding: 0;
    outline: none;
}

.theme-toggle-dot {
    position: absolute;
    top: 1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: left 0.3s, background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ── Cookie modal ── */
.cookie-box {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ── FAQ accordion ── */
.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}
.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
}
.faq-answer {
    padding: 0 1rem 1rem;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ── Cookie detail card ── */
.cookie-detail {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
}
.cookie-tag {
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
}
.cookie-tag-active {
    background: rgba(69, 220, 136, 0.15);
    color: var(--accent);
}
.cookie-tag-optional {
    background: rgba(158, 158, 158, 0.15);
    color: var(--text-muted);
}

/* ── Legal page text ── */
.legal-text {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}
.legal-heading {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

/* ── Auth page (centered login/register) ── */
.auth-separator {
    height: 1px;
    background: var(--border);
}
.auth-oauth-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text);
    transition: border-color 0.2s;
}
.auth-oauth-btn:hover { border-color: #555; }

/* ── Link styled ── */
.link-primary {
    color: var(--primary);
    text-decoration: none;
}
.link-primary:hover { text-decoration: underline; }

/* ── New project: selector cards ── */
.selector-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.selector-chip {
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-dark);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}
.selector-chip.active {
    background: rgba(92, 213, 207, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.selector-card {
    flex: 1;
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg-dark);
    border: 1.5px solid var(--border);
}
.selector-card.active {
    background: rgba(92, 213, 207, 0.12);
    border-color: var(--primary);
}
.selector-card .card-emoji { font-size: 18px; display: block; }
.selector-card .card-label {
    font-size: 12px;
    font-weight: 700;
    display: block;
    color: var(--text);
}
.selector-card.active .card-label { color: var(--primary); }
.selector-card .card-desc {
    font-size: 9px;
    color: var(--text-muted);
}
.selector-card { position: relative; }
.voice-play-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #090909;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
}
.voice-play-btn:hover { opacity: 1; transform: scale(1.1); }

/* ── New project: video preview ── */
.video-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid rgba(69, 220, 136, 0.4);
}
.video-thumb {
    width: 5rem;
    height: 3rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    font-size: 22px;
}

/* ── New project: mode toggle ── */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--bg-dark);
    cursor: pointer;
    font-size: 16px;
}
.mode-toggle-track {
    position: relative;
    width: 2.5rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: var(--border);
}
.mode-toggle-dot {
    position: absolute;
    top: 3px;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: var(--primary);
    transition: left 0.2s;
}

/* ── New project: config card wrapper ── */
.config-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
}

/* ── New project: cost summary ── */
.cost-line {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   Workspace: Timeline vertical
   ============================================================ */

/* ── Step wrapper ── */
.tl-step {
    position: relative;
    padding-left: 28px;
}

/* ── Vertical connector line ── */
.tl-line {
    position: absolute;
    left: 11px;
    top: 2rem;
    bottom: 0;
    width: 2px;
}
.tl-line-done   { background: rgba(69, 220, 136, 0.4); }
.tl-line-pending { background: var(--border); opacity: 0.4; }

/* ── Dot indicator ── */
.tl-dot {
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
    z-index: 1;
}
.tl-dot-pending      { background: var(--bg-light); border: 2px solid var(--border); color: var(--border); }
.tl-dot-running      { background: rgba(48, 226, 160, 0.2); border: 2px solid var(--primary); color: var(--primary); animation: pulse-soft 1.5s ease-in-out infinite; }
.tl-dot-waiting      { background: rgba(245, 158, 11, 0.2); border: 2px solid var(--warning); color: var(--warning); }
.tl-dot-completed    { background: rgba(69, 220, 136, 0.2); border: 2px solid var(--accent); color: var(--accent); }
.tl-dot-failed       { background: rgba(239, 68, 68, 0.2); border: 2px solid var(--error); color: var(--error); }
.tl-dot-invalidated  { background: rgba(245, 158, 11, 0.15); border: 2px solid var(--warning); color: var(--warning); }

/* ── Step card ── */
.tl-card {
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-light);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.tl-card-pending     { opacity: 0.5; }
.tl-card-running     { border-color: rgba(48, 226, 160, 0.6); }
.tl-card-waiting     { border-color: rgba(245, 158, 11, 0.6); }
.tl-card-failed      { border-color: rgba(239, 68, 68, 0.4); }
.tl-card-invalidated { border-color: rgba(245, 158, 11, 0.4); }

.tl-card-header {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tl-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.tl-card-icon { font-size: 16px; }
.tl-card-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.tl-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 0.5rem;
}
.tl-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tl-card-cost {
    font-size: 10px;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: var(--bg-dark);
    color: var(--text-muted);
}
.tl-card-status-running {
    font-size: 12px;
    font-family: monospace;
    color: var(--primary);
}
.tl-card-status-waiting {
    font-size: 12px;
    font-weight: 700;
    color: var(--warning);
}
.tl-card-status-completed {
    font-size: 14px;
    color: var(--accent);
}
.tl-card-status-failed {
    font-size: 12px;
    font-weight: 600;
    color: var(--error);
}

/* ── Step progress bar (inside card) ── */
.tl-progress {
    height: 3px;
    background: var(--bg-dark);
}
.tl-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

/* ── Step expanded content ── */
.tl-card-body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid var(--border);
}

/* ── Config summary bar ── */
.ws-config-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 1.5rem;
}
.ws-config-bar:hover {
    border-color: var(--primary);
}
.ws-config-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    font-size: 18px;
    flex-shrink: 0;
}
.ws-config-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Completed panel ── */
.ws-completed {
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
}
.ws-completed-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: var(--border);
    font-size: 32px;
}
.ws-download-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.ws-download-item {
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}
.ws-download-item:hover { border-color: var(--primary); }
.ws-download-item-icon { font-size: 20px; display: block; }
.ws-download-item-label { font-size: 12px; font-weight: 700; color: var(--text); display: block; margin-top: 0.25rem; }
.ws-download-item-detail { font-size: 9px; color: var(--text-muted); }

/* ============================================================
   Admin Panel
   ============================================================ */

/* ── Admin: Grid layout ── */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* ── Admin: Disabled card ── */
.admin-card-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Admin: Role cards ── */
.role-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}
.role-card-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.role-card-description {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ── Admin: API key cards ── */
.api-key-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}
.provider-logo {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    border-radius: 4px;
}
.password-toggle-container {
    position: relative;
}
.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}
.btn-verify {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(92, 213, 207, 0.08);
    border: 1px solid rgba(92, 213, 207, 0.25);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-verify:hover {
    background: rgba(92, 213, 207, 0.15);
    border-color: rgba(92, 213, 207, 0.5);
}
.btn-verify:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ── Admin: Credits grid layouts ── */
.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.admin-grid-2-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ── Admin: Stripe card accents ── */
.border-left-primary {
    border-left: 3px solid var(--primary);
}
.border-left-accent {
    border-left: 3px solid var(--accent);
}

/* ── Admin: Verify button inline variant ── */
.btn-verify-inline {
    width: auto;
    margin-top: 0;
    padding: 8px 12px;
}

/* ── Admin: Stripe input monospace ── */
.input-mono {
    font-family: monospace;
    font-size: 12px;
}

/* ── Admin: Warning notice ── */
.notice-warning {
    margin-top: 1rem;
    padding: 12px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning);
    border-radius: 8px;
}

/* ── Admin: KeyGate modal ── */
.keygate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.keygate-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 320px;
    text-align: center;
}
.keygate-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}
.keygate-input {
    font-size: 14px;
    letter-spacing: 2px;
}
.keygate-error {
    border-color: var(--error);
    animation: shake 0.5s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* ── Admin: Config Keys page ── */
.config-keys-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.config-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.admin-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.admin-config-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.admin-config-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.config-form-group {
    margin-bottom: 0.75rem;
}
.config-form-group:last-child {
    margin-bottom: 0;
}
.config-form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.password-input-group {
    display: flex;
    gap: 0;
}
.password-input-group input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.password-input-group .pwd-toggle {
    border: 1px solid var(--border);
    background: var(--bg-light);
    border-left: none;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    padding: 0 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.15s;
}
.password-input-group .pwd-toggle:hover {
    background: var(--bg-card);
    color: var(--text);
}
.config-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

@media (max-width: 1024px) {
    .config-keys-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .config-keys-grid { grid-template-columns: 1fr; }
}

/* ── Admin: Users table ── */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.75rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.admin-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.admin-table th.sortable:hover { color: var(--text); }
.admin-table th.sorted { color: var(--primary); }
.admin-table td {
    font-size: 13px;
    color: var(--text);
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table .user-inactive td { opacity: 0.4; }
.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
    background: transparent;
}
.action-btn:hover { background: var(--bg-light); }
.action-btn-danger:hover { background: rgba(239,68,68,0.15); }

/* Credits modal */
.credits-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
}
.credits-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    width: 340px;
    max-width: 90vw;
}
.credits-modal-box h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.credits-amount-input {
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text);
}
.credits-amount-input:focus { border-color: var(--primary); outline: none; }


/* ============================================================
   GALERIA DE IMAGENES
   ============================================================ */

/* Selector de estilo visual */
.img-style-selector {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.img-style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}
.img-style-btn {
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.img-style-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}
.img-style-btn.img-style-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.img-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.img-thumb-wrapper {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.img-thumb-wrapper:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.img-thumb-wrapper img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

/* Marcada para regenerar */
.img-thumb-wrapper.img-marked {
    border-color: var(--error);
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
    transform: translateY(-2px);
}
.img-thumb-wrapper.img-marked .img-mark-btn {
    background: var(--error);
    border-color: var(--error);
    color: #fff;
}

/* Recien regenerada */
.img-thumb-wrapper.img-regenerada,
.img-thumb-wrapper[data-regenerada="true"]:not(.img-marked) {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(69,220,136,0.3);
}

.img-mark-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.img-mark-btn:hover {
    background: rgba(0,0,0,0.7);
    border-color: #fff;
}

.img-new-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: var(--accent);
    color: #090909;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.img-gallery-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.img-selected-count {
    font-size: 12px;
    color: var(--text-muted);
}

.img-regen-btn {
    font-size: 12px;
    padding: 0.375rem 0.75rem;
}


/* ============================================================
   CARRUSEL MODAL
   ============================================================ */

.img-carousel-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-carousel-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    z-index: 3;
    line-height: 1;
}
.img-carousel-close:hover { color: #fff; }

.img-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    z-index: 3;
    transition: background 0.15s;
}
.img-carousel-arrow:hover {
    background: rgba(255,255,255,0.25);
}
.img-carousel-prev { left: 1rem; }
.img-carousel-next { right: 1rem; }

.img-carousel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 85vw;
    max-height: 85vh;
}

.img-carousel-img {
    max-width: 85vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

.img-carousel-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.img-carousel-counter {
    color: rgba(255,255,255,0.6);
}

.img-carousel-mark {
    font-size: 12px;
    padding: 0.25rem 0.75rem;
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.3);
}
.img-carousel-mark:hover {
    border-color: var(--error);
    color: var(--error);
}
.img-carousel-mark-active {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239,68,68,0.15);
}

/* ============================================================
   AUDIO CHUNKS GRID
   ============================================================ */

.audio-chunks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.audio-chunk-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.625rem;
    text-align: center;
    transition: border-color 0.2s;
}
.audio-chunk-card:hover {
    border-color: var(--primary);
}

.audio-chunk-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.audio-chunk-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.audio-chunk-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}


/* ============================================================
   MINIATURAS (THUMBNAILS)
   ============================================================ */

.mini-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mini-thumb-wrapper {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.mini-thumb-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    border-color: var(--primary);
}

.mini-thumb-wrapper img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.mini-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.35rem 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .img-gallery { grid-template-columns: repeat(2, 1fr); }
    .img-carousel-arrow { width: 36px; height: 36px; font-size: 1.25rem; }
    .audio-chunks-grid { grid-template-columns: repeat(2, 1fr); }
    .mini-gallery { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .img-gallery { grid-template-columns: repeat(3, 1fr); }
    .audio-chunks-grid { grid-template-columns: repeat(3, 1fr); }
    .mini-gallery { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   REVIEW DE VIRALIDAD
   ============================================================ */

.review-config-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.review-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.review-toggle-input {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

.review-threshold-circles {
    display: flex;
    gap: 0.35rem;
}

.threshold-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: transparent;
    transition: all 0.15s ease;
}

.threshold-circle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.threshold-circle.threshold-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(69, 220, 136, 0.1);
}

.review-result-panel {
    border-top: 2px solid var(--primary) !important;
}


/* ============================================================
   CREDITS PAGE
   ============================================================ */

.bg-grid {
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(92,213,207,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(92,213,207,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none; z-index: 0;
}

.bg-glow-1 {
    position: fixed; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(92,213,207,0.06) 0%, transparent 70%);
    top: -200px; right: -100px;
    pointer-events: none; z-index: 0;
}

.bg-glow-2 {
    position: fixed; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(69,220,136,0.05) 0%, transparent 70%);
    bottom: -150px; left: -100px;
    pointer-events: none; z-index: 0;
}

.credits-page {
    position: relative; z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 1.5rem;
}

.credits-header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.credits-page-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.25rem 0.85rem; border-radius: 100px;
    border: 1px solid var(--border);
    background: rgba(69,220,136,0.05);
    font-size: 0.7rem; font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.05em; text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.credits-page-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.credits-title {
    font-size: 3.5rem; font-weight: 800;
    letter-spacing: -0.03em; line-height: 1.1;
    margin-bottom: 0.5rem;
}

.credits-title .gradient-text {
    background: linear-gradient(135deg, #5cd5cf 0%, #45dc88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.credits-subtitle {
    font-size: 1.1rem; color: var(--text-muted);
    font-weight: 400;
    margin: 0 auto; line-height: 1.5;
    white-space: nowrap;
    text-align: center;
}

.credits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.credit-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.credit-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--border);
    transition: background 0.35s ease;
}

.credit-card:hover {
    border-color: var(--border);
    transform: translateY(-35px) rotate(-3deg) scale(1.25);
    box-shadow: 0 20px 40px rgba(0,0,0,0.95), 0 10px 15px rgba(0,0,0,0.9);
    z-index: 10;
}

.credit-card:hover::before {
    background: linear-gradient(135deg, #5cd5cf 0%, #45dc88 100%);
}

.credit-card.best-value {
    border-color: rgba(69,220,136,0.25);
    background: linear-gradient(180deg, rgba(69,220,136,0.04) 0%, var(--bg-card) 40%);
}

.credit-card.best-value::before {
    background: linear-gradient(135deg, #5cd5cf 0%, #45dc88 100%);
    height: 2px;
}

.best-tag {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    background: linear-gradient(135deg, #5cd5cf 0%, #45dc88 100%);
    color: #090909;
    font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-top-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}

.card-credits-block {
    display: flex;
    flex-direction: column;
}

.credit-amount {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--accent);
}

.credit-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.15rem;
}

.card-price-block {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
}

.price-amount {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
}

.credit-card.best-value .price-amount {
    background: linear-gradient(135deg, #5cd5cf 0%, #45dc88 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-currency {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-info-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.65rem;
}

.card-videos {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.card-videos strong {
    color: var(--text);
    font-weight: 600;
}

.card-unit-price {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-unit-price strong {
    color: var(--accent);
    font-weight: 600;
}

.credit-buy {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-align: center;
    text-decoration: none;
    display: block;
    margin-top: auto;
}

.credit-buy:hover {
    border-color: var(--text-muted);
    background: rgba(255,255,255,0.03);
}

.credit-card.best-value .credit-buy {
    background: linear-gradient(135deg, #5cd5cf 0%, #45dc88 100%);
    color: #090909;
    border: none;
    box-shadow: 0 4px 20px rgba(92,213,207,0.2);
}

.credit-card.best-value .credit-buy:hover {
    box-shadow: 0 6px 30px rgba(92,213,207,0.35);
    transform: translateY(-1px);
}

.credits-footer {
    text-align: center;
    margin-top: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.35s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.credit-card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.05s both; }
.credit-card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.credit-card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.15s both; }
.credit-card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.credit-card:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.25s both; }
.credit-card:nth-child(6) { animation: fadeInUp 0.6s ease-out 0.3s both; }

@media (max-width: 750px) {
    .credits-grid { grid-template-columns: repeat(2, 1fr); }
    .credits-title { font-size: 2rem; }
    .credits-subtitle { white-space: normal; }
}

@media (max-width: 450px) {
    .credits-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }
}


/* ============================================================
   LOGIN PAGE — Background effects
   ============================================================ */

.login-bg-effects {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
}

.login-bg-effects .bg-grid,
.login-bg-effects .bg-glow-1,
.login-bg-effects .bg-glow-2 {
    position: absolute;
}
