:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-hover: #22222f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #666680;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #2a2a3a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.navbar {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-auth, .nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-user {
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-plan {
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    font-weight: 600;
}

.words-badge {
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.words-badge span {
    color: var(--accent-primary);
    font-weight: 600;
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.humanizer-section {
    margin-top: 2rem;
}

.settings-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-group {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    border: 1px solid var(--border);
}

.toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-btn:hover {
    color: var(--text-primary);
}

.toggle-btn.active {
    background: var(--accent-gradient);
    color: white;
}

.toggle-btn.preferred {
    border: 1px solid rgba(139, 92, 246, 0.55);
    position: relative;
}

.toggle-btn.preferred.active {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

.toggle-btn .pill {
    margin-left: 0.45rem;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    padding: 0.15rem 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ede9fe;
    vertical-align: middle;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
}

.editor-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.panel-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.word-count {
    color: var(--text-muted);
}

.ai-score {
    color: var(--warning);
    font-weight: 600;
}

.ai-score.success {
    color: var(--success);
}

.editor-panel textarea {
    flex: 1;
    padding: 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    resize: none;
    font-family: inherit;
}

.editor-panel textarea:focus {
    outline: none;
}

.editor-panel textarea::placeholder {
    color: var(--text-muted);
}

.panel-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.action-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

.btn-humanize {
    background: var(--accent-gradient);
    color: white;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-humanize:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.btn-humanize:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-humanize .btn-icon {
    font-size: 1.25rem;
    transition: transform 0.3s;
}

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

.score-change {
    text-align: center;
    animation: fadeIn 0.3s ease;
}

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

.score-arrow {
    font-size: 1.5rem;
    color: var(--success);
}

.score-diff {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

.pricing-section {
    margin-top: 6rem;
    padding: 4rem 0;
    text-align: center;
}

.pricing-section h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.pricing-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: left;
    transition: all 0.3s;
    position: relative;
}

.pricing-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.pricing-card.popular {
    border-color: var(--accent-primary);
}

.pricing-card.popular::before {
    content: 'Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pricing-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.pricing-price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.pricing-words {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 600;
}

.promo-section {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.promo-section h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.promo-form {
    display: flex;
    gap: 0.75rem;
}

.promo-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.promo-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.promo-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
}

.promo-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.promo-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.modal-content > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

.modal-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.modal-switch a {
    color: var(--accent-primary);
    text-decoration: none;
}

.modal-switch a:hover {
    text-decoration: underline;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4rem;
}

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

.loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .action-column {
        flex-direction: row;
        padding: 1rem 0;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .settings-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .setting-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}
