/* =========================================================================
   STUDIO APP — Premium Dark Theme
   ========================================================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Core palette */
    --bg-deep: #0a0a12;
    --bg-surface: #12121e;
    --bg-card: rgba(22, 22, 38, 0.65);
    --bg-card-hover: rgba(30, 30, 52, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.04);

    /* Accent — Blue tones */
    --accent-primary: #3B82F6;
    --accent-secondary: #0EA5E9;
    --accent-pink: #06B6D4;
    --accent-orange: #0284C7;
    --accent-green: #10B981;
    --accent-red: #EF4444;

    /* Gradients — Blue theme */
    --grad-primary: linear-gradient(135deg, #3B82F6, #0EA5E9);
    --grad-warm: linear-gradient(135deg, #06B6D4, #0284C7);
    --grad-success: linear-gradient(135deg, #10B981, #06B6D4);
    --grad-error: linear-gradient(135deg, #EF4444, #DC2626);

    /* Text */
    --text-primary: #F0F0F8;
    --text-secondary: #9090B0;
    --text-muted: #5C5C7A;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(59, 130, 246, 0.4);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
    --shadow-btn: 0 4px 20px rgba(59, 130, 246, 0.35);

    /* Geometry */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Background Particles --- */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(600px circle at 20% 30%, rgba(59, 130, 246, 0.06) 0%, transparent 70%),
        radial-gradient(500px circle at 80% 60%, rgba(14, 165, 233, 0.05) 0%, transparent 70%),
        radial-gradient(400px circle at 50% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
    animation: bgFloat 20s ease-in-out infinite alternate;
}

@keyframes bgFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-40px, -30px) rotate(3deg); }
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 18, 0.75);
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    animation: logoSpin 8s ease-in-out infinite;
}

.logo-image {
    height: 48px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.2));
}

@keyframes logoSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.05); }
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
}

/* --- Auth Header --- */
.btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: white;
    background: var(--grad-primary);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.25s var(--ease-out);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
}

.btn-login svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    padding: 5px 5px 5px 14px;
    border-radius: 100px;
    border: 1px solid var(--border-subtle);
}

.user-badge-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: white;
    background: var(--grad-primary);
    padding: 2px 8px;
    border-radius: 100px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(255, 77, 106, 0.2);
    color: var(--accent-red);
}

/* --- Login Modal --- */
.login-card {
    position: relative;
    max-width: 380px !important;
    padding: 40px 36px !important;
    text-align: left !important;
}

.login-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.login-close:hover {
    background: rgba(255, 77, 106, 0.2);
    color: var(--accent-red);
}

.login-logo {
    margin-bottom: 18px;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-error {
    font-size: 13px;
    color: var(--accent-red);
    background: rgba(255, 77, 106, 0.1);
    border: 1px solid rgba(255, 77, 106, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 16px;
}

.btn-login-submit {
    width: 100%;
    justify-content: center;
    padding: 13px 24px !important;
    font-size: 15px !important;
    border-radius: var(--radius-md) !important;
    margin-top: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
    transition: background 0.3s;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Main --- */
.main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-card);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    animation: cardIn 0.6s var(--ease-out) both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.25s; }

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.step-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--grad-primary);
    color: white;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

/* --- Upload Zone (CSV) --- */
.upload-zone {
    border: 2px dashed rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-md);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    background: var(--bg-glass);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.06);
    transform: scale(1.005);
}

.upload-zone.drag-over::before {
    opacity: 0.05;
}

.upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    color: var(--accent-primary);
    opacity: 0.7;
    transition: transform 0.3s var(--ease-spring);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
    opacity: 1;
}

.upload-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-link {
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- File Preview --- */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    animation: fadeIn 0.3s var(--ease-out);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.btn-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 77, 106, 0.15);
    color: var(--accent-red);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: rgba(255, 77, 106, 0.3);
    transform: scale(1.1);
}

/* --- CSV Table Preview --- */
.csv-table-wrap {
    margin-top: 20px;
    animation: fadeIn 0.4s var(--ease-out);
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.csv-table-scroll {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.csv-table thead {
    background: rgba(59, 130, 246, 0.1);
}

.csv-table th {
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-primary);
    white-space: nowrap;
}

.csv-table td {
    padding: 10px 16px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-primary);
    white-space: nowrap;
}

.csv-table tbody tr {
    transition: background 0.15s;
}

.csv-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.csv-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: right;
}

/* --- Modelo Selector --- */
.modelo-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.modelo-option {
    cursor: pointer;
    flex: 1;
}

.modelo-option input[type="radio"] {
    display: none;
}

.modelo-option .modelo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s;
    user-select: none;
}

.modelo-option .modelo-card span {
    font-size: 0.85rem;
    font-weight: 500;
}

.modelo-option input[type="radio"]:checked + .modelo-card {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.12);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.modelo-option .modelo-card:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

/* --- Moldes Grid --- */
.moldes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.molde-card {
    position: relative;
}

.molde-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.molde-badge.required {
    background: var(--grad-warm);
    color: white;
}

.molde-badge.optional {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.molde-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 28px 12px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    background: var(--bg-glass);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.molde-dropzone {
    position: relative;
}

.molde-dropzone:hover,
.molde-dropzone.drag-over {
    border-color: var(--accent-secondary);
    background: rgba(171, 108, 255, 0.06);
    transform: translateY(-2px);
}

.molde-dropzone.filled {
    border-style: solid;
    border-color: rgba(52, 211, 153, 0.6);
    background: rgba(52, 211, 153, 0.08);
}

.molde-dropzone.filled:hover {
    border-color: rgba(52, 211, 153, 0.9);
    background: rgba(52, 211, 153, 0.12);
    transform: translateY(-2px);
}

.molde-dropzone.filled .molde-icon { color: rgba(52, 211, 153, 0.9); }
.molde-dropzone.filled .molde-label { color: var(--text-primary); }

.molde-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    transition: color 0.3s;
}

.molde-dropzone:hover .molde-icon {
    color: var(--accent-secondary);
}

.molde-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-remove-molde {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.btn-remove-molde:hover {
    background: var(--accent-red);
    transform: scale(1.15);
}

.btn-remove-molde.hidden {
    display: none;
}

/* --- Settings --- */
.card-settings .card-header.clickable {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    transition: margin-bottom 0.3s;
}

.card-settings .card-header.clickable.open {
    margin-bottom: 24px;
}

.optional-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 8px;
    vertical-align: middle;
}

.chevron {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-out);
}

.chevron.open {
    transform: rotate(180deg);
}

.settings-body {
    animation: slideDown 0.3s var(--ease-out);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.setting-group-full {
    grid-column: 1 / -1;
}

.settings-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    opacity: 0.7;
}

/* ---- Font Picker ---- */
.font-picker {
    position: relative;
}

.fp-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left;
    gap: 12px;
}

.fp-trigger:hover,
.fp-trigger.fp-open {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.fp-current {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.fp-preview-text {
    font-size: 22px;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-primary);
    min-width: 70px;
}

.fp-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.fp-trigger.fp-open .fp-chevron {
    transform: rotate(180deg);
}

.fp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 200;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
}

.fp-dropdown::-webkit-scrollbar { width: 4px; }
.fp-dropdown::-webkit-scrollbar-track { background: transparent; }
.fp-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.fp-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.fp-option:hover {
    background: rgba(255,255,255,0.07);
}

.fp-option-active {
    background: rgba(108,99,255,0.18);
    border: 1px solid rgba(108,99,255,0.35);
}

.fp-opt-preview {
    font-size: 20px;
    line-height: 1;
    color: var(--text-primary);
    min-width: 60px;
    white-space: nowrap;
}

.fp-opt-name {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select.input-field {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233B82F6' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
    background-color: rgba(59, 130, 246, 0.08);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    font-weight: 500;
    color: var(--text-primary);
}

select.input-field:hover {
    border-color: var(--accent-primary);
    background-color: rgba(59, 130, 246, 0.12);
}

select.input-field:focus {
    border-color: var(--accent-primary) !important;
    background-color: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

select.input-field option {
    background: #1e1e2e;
    color: var(--text-primary);
    font-weight: 500;
}

.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-color {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.input-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.input-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-hex {
    font-size: 14px;
    font-family: 'Inter', monospace;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Submit --- */
.submit-section {
    display: flex;
    justify-content: center;
    padding-top: 8px;
    animation: cardIn 0.6s var(--ease-out) 0.35s both;
}

.btn-submit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 48px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    color: white;
    background: var(--grad-primary);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.45);
}

.btn-submit:hover::before {
    opacity: 1;
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    width: 22px;
    height: 22px;
    display: flex;
    transition: transform 0.3s var(--ease-spring);
}

.btn-submit:hover .btn-icon {
    transform: translateX(4px);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s var(--ease-out);
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    animation: modalIn 0.4s var(--ease-spring);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-state h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Spinner */
.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--grad-primary);
    border-radius: 100px;
    transition: width 0.5s var(--ease-out);
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Success */
.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    color: var(--accent-green);
    animation: successBounce 0.5s var(--ease-spring);
}

@keyframes successBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.success-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: var(--grad-success);
    border: none;
    border-radius: var(--radius-xl);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
    transition: all 0.3s var(--ease-out);
    margin-bottom: 16px;
}

.btn-download svg {
    width: 20px;
    height: 20px;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74, 222, 128, 0.4);
}

/* Error */
.error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    color: var(--accent-red);
}

.error-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    word-break: break-word;
}

/* New Job / Retry Button */
.btn-new-job {
    display: inline-block;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new-job:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.08);
}

.btn-feedback {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    margin: 8px 0 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-feedback:hover {
    border-color: var(--border-active);
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}
.btn-feedback svg { color: var(--accent-secondary); }

.header-support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s, border-color .2s, background .2s;
}
.header-support-link:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: rgba(59, 130, 246, 0.08);
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: white;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.4s var(--ease-spring);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error {
    background: linear-gradient(135deg, #FF4D6A, #e8435b);
}

.toast.success {
    background: linear-gradient(135deg, #4ADE80, #22C55E);
    color: #064E3B;
}

.toast.info {
    background: linear-gradient(135deg, #6C63FF, #8B5CF6);
}

.toast.leaving {
    animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.9);
    }
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .card {
        padding: 20px 18px;
    }

    .moldes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .btn-submit {
        width: 100%;
        justify-content: center;
    }

    .modal-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .moldes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .molde-dropzone {
        padding: 20px 8px 16px;
        min-height: 120px;
    }

    .card-header h2 {
        font-size: 17px;
    }
}

/* =========================================================================
   Lista de Jogadores — tabela editável
   ========================================================================= */

/* Toolbar acima da tabela */
.jogadores-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-toggles {
    display: flex;
    gap: 16px;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
}

/* Toggle switch (checkbox estilizado) */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.toggle-label:hover {
    background: rgba(59, 130, 246, 0.08);
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-track {
    position: relative;
    width: 48px;
    height: 26px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid var(--border-subtle);
    border-radius: 13px;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-track {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.toggle-label input:checked + .toggle-track .toggle-thumb {
    transform: translateX(22px);
    background: white;
}

.toggle-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Botões de adicionar linha */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-add:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent);
}

.btn-add-seletor {
    color: var(--accent-light, #a5a0ff);
    border-color: rgba(59, 130, 246, 0.3);
}

.btn-add-seletor:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Colunas especiais */
.col-idx {
    width: 36px;
    color: var(--text-muted);
    text-align: center;
}

.col-action {
    width: 36px;
    text-align: center;
}

.col-disabled {
    opacity: 0.4;
}

/* Inputs dentro das células */
.cell-input {
    width: 100%;
    min-width: 80px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

.cell-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
}

.cell-input:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cell-qtd {
    min-width: 56px;
    max-width: 72px;
    text-align: center;
}

/* Select dentro das células */
.cell-select {
    width: 100%;
    min-width: 70px;
    padding: 6px 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1.5px solid rgba(59, 130, 246, 0.25);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.cell-select:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--accent-primary);
}

.cell-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Botão remover linha */
.btn-remove-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin: 0 auto;
}

.btn-remove-row:hover {
    background: rgba(255, 80, 80, 0.15);
    color: #ff6b6b;
}

/* Linha de seletor — destaque sutil */
.csv-table tbody tr.row-seletor {
    background: rgba(59, 130, 246, 0.04);
}

.csv-table tbody tr.row-seletor:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* ---- Separador "ou criar manualmente" ---- */
.csv-manual-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0 4px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.btn-criar-manualmente {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px dashed var(--border-active);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-criar-manualmente:hover {
    background: rgba(59, 130, 246, 0.1);
    border-style: solid;
    color: var(--accent-secondary);
}

/* Linha goleiro — destaque dourado */
.csv-table tbody tr.row-goleiro {
    background: rgba(255, 215, 0, 0.05);
}

.csv-table tbody tr.row-goleiro:hover {
    background: rgba(255, 215, 0, 0.10);
}

/* Botão Voltar para CSV */
.btn-voltar-csv {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.btn-voltar-csv:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: var(--bg-glass);
}

/* Botão + Goleiro */
.btn-add-goleiro {
    color: #c9a800;
    border-color: rgba(255, 215, 0, 0.35);
}

.btn-add-goleiro:hover {
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.6);
    color: #FFD700;
}

/* ---- Tabs de Moldes (Jogadores / Goleiros) ---- */
.moldes-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
}

.moldes-tab {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 8px 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.moldes-tab.active {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-btn);
}

.moldes-tab:hover:not(.active) {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: var(--bg-glass);
}

.moldes-tab-panel {
    /* sem estilos extras — usa o layout existente */
}

@media (max-width: 600px) {
    .jogadores-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .moldes-tabs {
        flex-wrap: wrap;
    }
}

/* =========================================================================
   Purchase Modal — Packs de Créditos + PIX
   ========================================================================= */

.purchase-card {
    max-width: 720px;
    width: 92%;
}

.purchase-title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    text-align: center;
}

.purchase-subtitle {
    margin: 0 0 20px;
    text-align: center;
    color: var(--text-secondary, #9aa);
    font-size: 0.95rem;
}

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

.plan-card {
    position: relative;
    padding: 18px 14px;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 12px;
    background: var(--bg-glass, rgba(255,255,255,0.03));
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-active, rgba(255,255,255,0.25));
}

.plan-featured {
    border-color: var(--accent, #6aa2ff);
    box-shadow: 0 0 0 1px var(--accent, #6aa2ff) inset;
}

.plan-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary, #9aa);
    margin-bottom: 10px;
}

.plan-badge.featured {
    background: var(--accent, #6aa2ff);
    color: #fff;
}

.plan-credits {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
}

.plan-credits-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #9aa);
    margin-bottom: 8px;
}

.plan-price {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.plan-detail {
    font-size: 0.8rem;
    color: var(--text-secondary, #9aa);
    margin-bottom: 14px;
}

.btn-plan {
    width: 100%;
}

/* PIX area */
.pix-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 4px;
}

.pix-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.pix-subtitle {
    margin: 0 0 10px;
    color: var(--text-secondary, #9aa);
    font-size: 0.9rem;
    text-align: center;
}

/* ── Countdown ──────────────────────────────────────────────────── */
.pix-countdown {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.countdown-ring {
    width: 64px;
    height: 64px;
    transform: rotate(-90deg);
}

.countdown-track {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 4;
}

.countdown-progress {
    fill: none;
    stroke: var(--accent, #6aa2ff);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.9s linear, stroke 0.4s ease;
}

.countdown-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ── QR ─────────────────────────────────────────────────────────── */
.pix-qr-wrap {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.pix-qr-wrap img {
    display: block;
    width: 200px;
    height: 200px;
}

/* ── Copia-e-cola ───────────────────────────────────────────────── */
.pix-copy-wrap {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 460px;
    margin-bottom: 10px;
}

.pix-copy-wrap input {
    flex: 1;
    font-family: monospace;
    font-size: 0.78rem;
    min-width: 0;
}

.btn-copy-pix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 42px;
    border: 1px solid var(--border-active, rgba(255,255,255,0.2));
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.btn-copy-pix:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.35);
}

.btn-copy-pix.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

/* ── Aguardando ─────────────────────────────────────────────────── */
.pix-waiting {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary, #9aa);
    font-size: 0.88rem;
    margin: 4px 0 0;
}

.pix-waiting-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #6aa2ff);
    animation: pulse-dot 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Botão Voltar ───────────────────────────────────────────────── */
.btn-pix-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 16px;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #9aa);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-pix-back:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.18);
    color: var(--text-primary, #fff);
}

.btn-pix-back svg {
    opacity: 0.7;
    transition: transform 0.15s, opacity 0.15s;
}

.btn-pix-back:hover svg {
    transform: translateX(-2px);
    opacity: 1;
}

@media (max-width: 640px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    .pix-qr-wrap img {
        width: 180px;
        height: 180px;
    }
}
