:root {
    /* Color Palette - Ultra Premium Deep Navy & Cyber Cyan */
    --primary: #00f2ff;
    --primary-glow: rgba(0, 242, 255, 0.4);
    --primary-dark: #0088cc;
    --bg-dark: #05080f;
    /* Deep Navy Black */
    --bg-gradient: radial-gradient(circle at top right, #0a1628 0%, #05080f 100%);
    --card-bg: rgba(15, 23, 42, 0.75);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-bright: rgba(255, 255, 255, 0.15);
    --accent-red: #ff3e3e;
    --success: #10b981;

    /* System Stats */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-premium: 0 20px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Global Smoothness */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #05080f !important;
    /* Force Dark Background */
    background-image: var(--bg-gradient) !important;
    background-attachment: fixed;
    color: var(--text-main) !important;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Persistent Background Aura */
.glass-background {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150vw;
    height: 150vh;
    background: radial-gradient(circle at center, #1e3a8a 0%, transparent 60%);
    opacity: 0.15;
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
    animation: pulseAura 15s ease-in-out infinite alternate;
}

@keyframes pulseAura {
    from {
        opacity: 0.1;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Main Header - Mobile Responsive */
.main-header {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
    /* Fallback */
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: -4px;
}

/* Accessibility Buttons */
.accessibility-controls {
    display: flex;
    gap: 0.75rem;
}

.accessibility-controls button {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.accessibility-controls button:hover,
.accessibility-controls button:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Layout Engine */
.app-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Card System - Premium Glass */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border-bright);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 850px;
    box-shadow: var(--shadow-premium);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Interactive Dropzone */
.dropzone {
    border: 2px dashed rgba(0, 242, 255, 0.2);
    border-radius: 20px;
    padding: 5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.dropzone:hover {
    border-color: var(--primary);
    background: rgba(0, 242, 255, 0.03);
    transform: scale(0.995);
}

.dropzone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.dropzone:hover::before {
    opacity: 0.1;
}

.dropzone-content {
    position: relative;
    z-index: 1;
}

.icon-upload {
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
    margin-bottom: 1.5rem;
}

.dropzone-content p {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Dynamic Progress Bar */
.progress-container {
    margin: 2.5rem 0;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
    transition: width 0.4s ease;
    box-shadow: 0 0 20px var(--primary-glow);
}

#status-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Advanced Button System */
.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 10px 20px -5px var(--primary-glow);
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border-bright);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn:active {
    transform: scale(0.96);
}

/* Results Section Optimization */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Universal Text Reader Container */
.text-display {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 2.5rem;
    min-height: 350px;
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.8;
    color: #e2e8f0;
    font-size: 1.15rem;
    white-space: pre-wrap;
    border: 1px solid var(--glass-border);
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.text-display::-webkit-scrollbar {
    width: 6px;
}

.text-display::-webkit-scrollbar-thumb {
    background: var(--glass-border-bright);
    border-radius: 10px;
}

/* Integrated Audio Card */
.audio-controls-card {
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.15);
    border-radius: 22px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: var(--primary);
    opacity: 0.8;
}

#btn-play-pause {
    background: var(--primary);
    color: #000;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 30px var(--primary-glow);
    transition: var(--transition-smooth);
    border: none;
}

#btn-play-pause:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px var(--primary-glow);
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.voice-params {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.voice-params label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Range Input Stylization */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 5px;
    accent-color: var(--primary);
}

/* Editable Textarea Styling */
textarea.text-display {
    width: 100%;
    resize: vertical;
    outline: none;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
    transition: var(--transition-smooth);
}

textarea.text-display:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.15);
    background: rgba(15, 23, 42, 0.7);
}

/* ABNT Form Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.abnt-form input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.abnt-form input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Navigation Controls - Base Styles */
.navigation-controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* Footer Excellence */
.app-footer {
    padding: 3rem 5%;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.creator-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.creator-info strong {
    color: var(--primary);
    font-weight: 700;
}

/* Responsive Grid & Media Queries */

/* Tablet & Smaller Desktop */
@media (max-width: 900px) {
    .app-container {
        padding: 1.5rem;
    }

    .card {
        padding: 2rem;
    }
}

/* Mobile Devices (Smartphones) */
@media (max-width: 600px) {
    html {
        font-size: 15px;
    }

    .main-header {
        padding: 1.25rem 5%;
    }

    .logo {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.5rem 1.25rem;
        border-radius: 20px;
    }

    .card h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .dropzone {
        padding: 3.5rem 1rem;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
        padding: 0.85rem;
    }

    .playback-controls {
        flex-direction: column-reverse;
        gap: 1.5rem;
        width: 100%;
    }

    .voice-params {
        width: 100%;
    }

    #btn-play-pause {
        width: 56px;
        height: 56px;
        margin: 0 auto;
    }

    .text-display {
        padding: 1.5rem;
        font-size: 1.05rem;
        min-height: 250px;
    }

    .navigation-controls {
        flex-direction: column;
        gap: 1rem;
    }
}

/* High Contrast Mode Overrides */
.high-contrast {
    --bg-dark: #000;
    --card-bg: #000;
    --text-main: #fff;
    --primary: #fff200;
    --glass-border: #fff;
    --glass-border-bright: #fff;
    --primary-glow: transparent;
}

.high-contrast .glass-background {
    display: none;
}

.high-contrast .card {
    border: 2px solid #fff;
}

.high-contrast .dropzone {
    border: 3px dashed #fff200;
}

/* Desktop-specific optimization for reading */
@media (min-width: 1200px) {
    .text-display {
        font-size: 1.25rem;
        max-width: 80ch;
        margin-left: auto;
        margin-right: auto;
    }
}

/* PREMIUM MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.payment-modal {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 950px;
    width: 95%;
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.15);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .payment-modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-main-fixed);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.1) rotate(90deg);
}

.payment-header {
    text-align: center;
    margin-bottom: 2rem;
}

.payment-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.payment-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.pricing-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.active-plan-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--success);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    z-index: 10;
}

.pricing-card:hover {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-5px);
}

.pricing-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 242, 255, 0.1) 0%, rgba(15, 23, 42, 0.5) 100%);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.1);
}

.pricing-card.featured::before {
    content: "ECONOMIZE 15%";
    position: absolute;
    top: 12px;
    right: -35px;
    background: var(--primary);
    color: #000;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 40px;
    transform: rotate(45deg);
}

.price {
    font-size: 2.2rem;
    font-weight: 800;
    display: block;
    margin: 1rem 0;
    color: var(--text-main-fixed);
}

.price span {
    font-size: 0.9rem;
    opacity: 0.6;
    font-weight: 400;
}

.pricing-card h4 {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.pricing-features {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pricing-features li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-features li::before {
    content: "✓";
    color: var(--primary);
    font-weight: bold;
}

/* PREMIUM BADGE */
.premium-badge {
    background: var(--primary);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    display: inline-block;
}

.high-contrast .premium-badge {
    background: #fff200;
}

/* MERCADO PAGO UI */
.mp-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mp-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.mp-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

.mp-icon {
    font-size: 1.5rem;
    background: rgba(0, 242, 255, 0.1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.mp-info {
    display: flex;
    flex-direction: column;
}

.mp-info strong {
    color: var(--text-main-fixed);
    font-size: 1rem;
}

.mp-info span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Spinner for processing */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 242, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utilities */
.hidden {
    display: none !important;
}