/* === NoirPaste — Monochrome Darkweb Aesthetic ===
 * Dark-first design. Light mode via .light.
 * No external resources. System font stack. Minimal, premium feel.
 * Monochrome palette — blacks, whites, grays. Clean. Brutalist-adjacent.
 */

/* --- CSS Variables (Dark Theme — default) --- */
:root,
.dark {
    --color-bg: #060608;
    --color-bg-elevated: #0c0c10;
    --color-bg-card: #111116;
    --color-bg-input: #09090e;
    --color-bg-hover: #18181f;
    --color-border: #1e1e28;
    --color-border-light: #16161f;
    --color-border-focus: #3f3f50;
    --color-text: #9a9aab;
    --color-text-dim: #6b6b7e;
    --color-text-bright: #ededf5;
    --color-text-muted: #4a4a5a;
    --color-accent: #d4a853;
    --color-accent-glow: rgba(212, 168, 83, 0.1);
    --color-accent-hover: #e6c06e;
    --color-accent-dim: #7a6440;
    --color-error: #f87171;
    --color-error-bg: rgba(248, 113, 113, 0.06);
    --color-success: #4ade80;
    --color-success-bg: rgba(74, 222, 128, 0.06);
    --color-warning: #fbbf24;
    --color-code-bg: #08080d;
    --color-surface-1: #111116;
    --color-surface-2: #18181f;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.6), 0 0 1px rgba(255,255,255,0.02);
    --shadow-glow: 0 0 60px rgba(212, 168, 83, 0.05), 0 0 4px rgba(212, 168, 83, 0.08);
    --shadow-glow-strong: 0 0 40px rgba(212, 168, 83, 0.12), 0 0 8px rgba(212, 168, 83, 0.1);
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Cascadia Code", "JetBrains Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Light Theme --- */
.light {
    --color-bg: #fafafa;
    --color-bg-elevated: #ffffff;
    --color-bg-card: #ffffff;
    --color-bg-input: #f4f4f5;
    --color-bg-hover: #f4f4f5;
    --color-border: #e4e4e7;
    --color-border-light: #e4e4e7;
    --color-border-focus: #a1a1aa;
    --color-text: #52525b;
    --color-text-dim: #a1a1aa;
    --color-text-bright: #09090b;
    --color-text-muted: #a1a1aa;
    --color-accent: #8b6914;
    --color-accent-glow: rgba(139, 105, 20, 0.06);
    --color-accent-hover: #6b5010;
    --color-accent-dim: #a17f4a;
    --color-error: #ef4444;
    --color-error-bg: rgba(239, 68, 68, 0.06);
    --color-success: #22c55e;
    --color-success-bg: rgba(34, 197, 94, 0.06);
    --color-warning: #f59e0b;
    --color-code-bg: #f4f4f5;
    --color-surface-1: #f4f4f5;
    --color-surface-2: #e4e4e7;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-glow: none;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--color-bg); }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


a { color: var(--color-accent); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--color-accent-hover); }

code, pre, kbd {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

code { background: var(--color-surface-1); padding: 0.15rem 0.4rem; border-radius: 3px; font-size: 0.825rem; color: var(--color-text-bright); }

::selection { background: var(--color-accent); color: #0a0a0f; }

/* --- Header --- */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.logo {
    display: flex; align-items: center; gap: 0.625rem;
    color: var(--color-text-bright); font-weight: 700; font-size: 1.125rem;
    letter-spacing: -0.02em;
}
.logo:hover { color: var(--color-text-bright); }
.logo-icon { flex-shrink: 0; color: var(--color-accent); }
.logo-accent { color: var(--color-accent); }
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav a {
    color: var(--color-text-dim); font-size: 0.875rem; font-weight: 500;
    transition: color 0.15s; display: flex; align-items: center; gap: 0.4rem;
}
.header-nav a:hover { color: var(--color-text); }
.nav-icon { flex-shrink: 0; opacity: 0.7; transition: opacity 0.15s; }
.header-nav a:hover .nav-icon { opacity: 1; }

.theme-toggle {
    background: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    color: var(--color-text-dim); cursor: pointer; padding: 0.4rem;
    line-height: 1; transition: all 0.15s; display: flex; align-items: center;
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-icon-dark { display: block; }
.theme-icon-light { display: none; }
.light .theme-icon-dark { display: none; }
.light .theme-icon-light { display: block; }

/* --- Generic icon sizing --- */
.icon-sm { width: 14px; height: 14px; flex-shrink: 0; }
.icon-md { width: 18px; height: 18px; flex-shrink: 0; }
.icon-lg { width: 24px; height: 24px; flex-shrink: 0; }

/* --- Hamburger Menu --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px; height: 40px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 220;
    padding: 0;
    transition: border-color 0.2s ease;
}
.menu-toggle:hover { border-color: var(--color-accent); }
.menu-bar {
    display: block;
    width: 20px; height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
/* Animate hamburger to X when menu is open (via body class) */
body.menu-open .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.menu-open .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay — above everything except nav panel + toggle */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.menu-overlay.overlay-visible {
    display: block;
    opacity: 1;
}

/* --- Responsive Navigation --- */
@media (max-width: 640px) {
    .menu-toggle { display: flex; }

    .header-nav {
        position: fixed;
        top: 0; right: 0;
        width: 280px; max-width: 80vw;
        height: 100dvh;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--color-bg-elevated);
        border-left: 1px solid var(--color-border);
        padding: 80px 1.5rem 2rem;
        z-index: 210;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
        box-shadow: none;
    }
    .header-nav.nav-open {
        transform: translateX(0);
        box-shadow: -8px 0 30px rgba(0,0,0,0.4);
    }
    .header-nav a {
        font-size: 1.05rem;
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--color-border-light);
        color: var(--color-text);
    }
    .header-nav a:last-of-type { border-bottom: none; }

    .theme-toggle {
        margin-top: 1.5rem;
        align-self: center;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-dim);
}
.footer-onion { color: var(--color-accent); }

/* --- Typography --- */
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.5rem; color: var(--color-text-bright); }
.page-subtitle { color: var(--color-text-dim); margin-bottom: 2rem; font-size: 0.95rem; }
.accent { color: var(--color-accent); }

/* --- Forms --- */
.paste-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.8125rem; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.form-hint { font-size: 0.75rem; color: var(--color-text-dim); }
.form-optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

.form-textarea, .form-input, .form-select {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
}
.form-textarea:focus, .form-input:focus, .form-select:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}
.form-textarea { resize: vertical; min-height: 240px; }
.form-input { font-family: var(--font-sans); }
.form-select { font-family: var(--font-sans); cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-checks { display: flex; gap: 2rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.875rem; }
.form-check input[type="checkbox"] {
    accent-color: var(--color-accent); width: 16px; height: 16px;
}
.form-footer-text {
    font-size: 0.8rem; color: var(--color-text-dim); text-align: center;
    margin-top: 0.5rem; line-height: 1.5;
}

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; transition: all 0.15s; font-family: var(--font-sans);
    text-decoration: none; gap: 0.4rem; white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: #0a0a0f; border-color: var(--color-accent); font-weight: 600; }
.btn-primary:hover { background: var(--color-accent-hover); color: #0a0a0f; border-color: var(--color-accent-hover); }
.btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* --- Alerts --- */
.alert {
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.875rem; margin-bottom: 1rem;
}
.alert-error { background: var(--color-error-bg); color: var(--color-error); border: 1px solid var(--color-error); }

/* --- Paste View --- */
.paste-meta {
    display: flex; flex-wrap: wrap; gap: 1rem 2rem;
    padding: 1rem 1.25rem; background: var(--color-bg-card);
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.meta-item { display: flex; flex-direction: column; gap: 0.15rem; }
.meta-label { font-size: 0.6875rem; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.meta-value { font-size: 0.8125rem; font-family: var(--font-mono); color: var(--color-text); }
.meta-burn .meta-value { color: var(--color-warning); }

.paste-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 1rem; background: var(--color-bg-card);
    border: 1px solid var(--color-border); border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.toolbar-label { font-size: 0.75rem; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.toolbar-actions { display: flex; gap: 0.5rem; }

.paste-content {
    padding: 1.25rem; background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow-x: auto;
    position: relative;
}
.paste-content pre { margin: 0; white-space: pre-wrap; word-break: break-all; }
.paste-content code { color: var(--color-text); line-height: 1.7; }

.paste-footer-hint {
    margin-top: 1.5rem; padding: 1rem; background: var(--color-bg-card);
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    font-size: 0.8rem; color: var(--color-text-dim); line-height: 1.6;
}
.paste-footer-hint strong { color: var(--color-text); }
.paste-footer-hint code { background: var(--color-bg-input); padding: 0.15rem 0.4rem; border-radius: 3px; }

/* --- Created Page --- */
.created-section { text-align: center; }
.created-card {
    max-width: 640px; margin: 0 auto; padding: 2.5rem;
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-glow);
}
.created-icon {
    width: 56px; height: 56px; margin: 0 auto 1.25rem;
    background: var(--color-success-bg); color: var(--color-success);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: bold;
}
.created-subtitle { color: var(--color-text-dim); margin-bottom: 1.5rem; line-height: 1.6; }
.paste-url-box { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.url-display { font-family: var(--font-mono); font-size: 0.8rem; }
.paste-details {
    text-align: left; background: var(--color-bg-input);
    border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.4rem 0; border-bottom: 1px solid var(--color-border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.75rem; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; }
.detail-row code { font-size: 0.8rem; word-break: break-all; text-align: right; max-width: 60%; }
.delete-token { font-size: 0.7rem !important; color: var(--color-warning); }
.detail-hint { display: block; font-size: 0.7rem; color: var(--color-text-dim); margin-top: 0.2rem; }
.created-actions { display: flex; gap: 1rem; justify-content: center; }

/* --- Password Section --- */
.password-section { text-align: center; padding: 3rem 1rem; }
.password-form { display: flex; gap: 0.5rem; max-width: 400px; margin: 1.5rem auto 0; }

/* --- API Docs --- */
.api-section { max-width: 800px; }
.api-endpoint {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1rem;
}
.api-method {
    display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; font-family: var(--font-mono);
    text-transform: uppercase; letter-spacing: 0.05em; margin-right: 0.75rem;
}
.method-post { background: rgba(139, 92, 246, 0.15); color: var(--color-accent); }
.method-get { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.method-delete { background: rgba(239, 68, 68, 0.15); color: var(--color-error); }
.api-path { font-family: var(--font-mono); font-size: 0.9rem; color: var(--color-text-bright); }
.api-desc { font-size: 0.85rem; color: var(--color-text-dim); margin-top: 0.5rem; }

/* --- Payment Page --- */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
.pricing-card {
    background: var(--color-bg-card); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 2rem; text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pricing-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-glow); }
.pricing-card.premium { border-color: var(--color-accent); }
.pricing-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.75rem; }
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--color-accent); margin-bottom: 0.25rem; }
.pricing-period { font-size: 0.85rem; color: var(--color-text-dim); margin-bottom: 1.25rem; }
.pricing-features { text-align: left; list-style: none; margin-bottom: 1.5rem; }
.pricing-features li { padding: 0.4rem 0; font-size: 0.875rem; }
.pricing-features li::before { content: "✓ "; color: var(--color-success); font-weight: bold; }
.qr-container { margin: 2rem auto; text-align: center; }
.qr-container svg { max-width: 200px; border-radius: var(--radius-sm); }

/* --- Micro-Interactions & Animations --- */

/* Page entry */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes checkDraw {
    from { stroke-dashoffset: 24; }
    to { stroke-dashoffset: 0; }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(212, 168, 83, 0); }
}
@keyframes borderFlash {
    0% { border-color: var(--color-border); }
    50% { border-color: var(--color-accent); }
    100% { border-color: var(--color-border); }
}

/* Apply entry animations */
.main-content > section > .container > *:first-child { animation: fadeInUp 0.4s ease; }
.created-card { animation: scaleIn 0.35s ease; }
.paste-content-wrapper { animation: fadeIn 0.3s ease; }
.api-endpoint { animation: fadeInUp 0.3s ease; }
.api-endpoint:nth-child(2) { animation-delay: 0.05s; }
.api-endpoint:nth-child(3) { animation-delay: 0.1s; }
.api-endpoint:nth-child(4) { animation-delay: 0.15s; }
.api-endpoint:nth-child(5) { animation-delay: 0.2s; }
.api-endpoint:nth-child(6) { animation-delay: 0.25s; }
.paste-meta { animation: slideDown 0.3s ease; }
.alert { animation: slideDown 0.25s ease; }

/* Form element states — transition-based, no animations that stick on mobile */
.form-textarea, .form-input, .form-select {
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
    box-shadow: 0 0 0 0 transparent;
}
.form-textarea:hover, .form-input:hover, .form-select:hover {
    border-color: var(--color-text-muted);
}
.form-textarea:focus, .form-input:focus, .form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
    outline: none;
}
/* Ensure focus ring clears on blur — mobile critical */
.form-textarea:not(:focus), .form-input:not(:focus), .form-select:not(:focus) {
    border-color: var(--color-border);
    box-shadow: 0 0 0 0 transparent;
}

/* Buttons */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}
.btn:active { transform: scale(0.96); }
/* On mobile, ensure active state clears */
.btn:not(:active) { transform: scale(1); }
.btn:active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.08);
    border-radius: inherit;
    animation: fadeIn 0.1s ease;
    pointer-events: none;
}
.btn-primary:active::after {
    background: rgba(0,0,0,0.12);
}
/* Prevent sticky hover on mobile */
@media (hover: hover) {
    .btn:hover { transform: translateY(-1px); }
    .btn-primary:hover {
        box-shadow: 0 0 24px rgba(212, 168, 83, 0.2);
    }
}

/* Loading state */
.btn-loading {
    pointer-events: none;
    color: transparent !important;
}
.btn-loading::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Cards & surfaces */
.pricing-card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
    .pricing-card:hover { transform: translateY(-3px); }
}

.api-endpoint {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    touch-action: manipulation;
}
@media (hover: hover) {
    .api-endpoint:hover {
        border-color: var(--color-border-focus);
        box-shadow: var(--shadow-glow);
        transform: translateX(2px);
    }
}

/* Paste content hover */
.paste-content {
    transition: border-color 0.2s ease;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--color-text);
    box-shadow: var(--shadow-card);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    max-width: 360px;
}
.toast-success { border-color: var(--color-success); }
.toast-success::before {
    content: '✓';
    color: var(--color-success);
    font-weight: bold;
}
.toast-error { border-color: var(--color-error); }
.toast-error::before {
    content: '✕';
    color: var(--color-error);
    font-weight: bold;
}
.toast-exit { animation: toastOut 0.25s ease forwards; }

/* Character counter */
#char-count {
    transition: color 0.2s ease;
    font-variant-numeric: tabular-nums;
}
#char-count.near-limit { color: var(--color-warning); }
#char-count.at-limit { color: var(--color-error); }
#char-count.over-limit { color: var(--color-error); font-weight: 600; }

/* Reactive validation */
.field-error {
    color: var(--color-error);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}
.input-error {
    border-color: var(--color-error) !important;
    box-shadow: 0 0 0 1px var(--color-error) !important;
}
.form-required {
    color: var(--color-error);
    font-weight: 600;
}
.premium-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: var(--color-bg);
    vertical-align: middle;
    margin-left: 0.25rem;
    cursor: help;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Copy feedback */
.copy-flash {
    animation: borderFlash 0.5s ease;
}

/* Password form transition */
.password-form {
    transition: opacity 0.2s ease;
}

/* Focus ring — keyboard only, not touch */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}
/* Reset focus outline for mouse/touch users */
:focus:not(:focus-visible) {
    outline: none;
}
/* Double-ensure mobile taps don't leave focus rings */
@media (pointer: coarse) {
    :focus-visible {
        outline-width: 0;
    }
    .form-textarea:focus-visible,
    .form-input:focus-visible,
    .form-select:focus-visible {
        outline-width: 2px;
    }
}

/* Checkbox feedback */
.form-check input[type="checkbox"] {
    transition: transform 0.15s ease;
}
.form-check input[type="checkbox"]:active {
    transform: scale(0.85);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--color-surface-1) 25%, var(--color-surface-2) 50%, var(--color-surface-1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* Refined form elements */
.form-textarea::placeholder, .form-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Paste meta count */
.view-count-bump { animation: scaleIn 0.3s ease; }

/* Link underline animation */
a:not(.btn):not(.logo):not(.header-nav a) {
    background: linear-gradient(var(--color-accent), var(--color-accent)) left bottom / 0 1px no-repeat;
    transition: background-size 0.3s ease;
    padding-bottom: 1px;
}
@media (hover: hover) {
    a:not(.btn):not(.logo):not(.header-nav a):hover {
        background-size: 100% 1px;
    }
}

/* Mobile tap: ensure focus clears when tapping empty areas */
@media (pointer: coarse) {
    .form-textarea, .form-input, .form-select, .btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .paste-meta { gap: 0.5rem 1rem; }
    .page-title { font-size: 1.5rem; }
    .header-nav a { font-size: 0.8rem; }
}

/* --- Custom Modal --- */
.modal-overlay {
    position: fixed; inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-dialog {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 440px; width: 90vw;
    box-shadow: var(--shadow-glow-strong), 0 4px 24px rgba(0,0,0,0.5);
    animation: scaleIn 0.2s ease;
}
.modal-body { margin-bottom: 1.25rem; color: var(--color-text); line-height: 1.6; }
.modal-body code {
    background: var(--color-code-bg); padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm); font-size: 0.85rem;
    word-break: break-all; display: block; margin: 0.5rem 0;
    border: 1px solid var(--color-border); color: var(--color-accent);
}
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Utility */
.container { width: 100%; }

/* --- Pygments Syntax Highlighting (Dark Theme) --- */
.highlight { background: var(--color-code-bg); border-radius: var(--radius-sm); }
.highlight pre { margin: 0; padding: 1rem; overflow-x: auto; line-height: 1.6; }
.highlight .hll { background-color: rgba(255,255,255,0.04); }
.highlight .c { color: #6b7280; font-style: italic; }   /* Comment */
.highlight .k { color: #d4d4d8; font-weight: 600; }     /* Keyword */
.highlight .o { color: #a1a1aa; }                        /* Operator */
.highlight .s { color: #86efac; }                        /* String */
.highlight .n { color: #d4d4d8; }                        /* Name */
.highlight .p { color: #a1a1aa; }                        /* Punctuation */
.highlight .m { color: #fbbf24; }                        /* Number */
.highlight .kc { color: #d4d4d8; font-weight: 600; }     /* Keyword.Constant */
.highlight .kd { color: #d4d4d8; font-weight: 600; }     /* Keyword.Declaration */
.highlight .kn { color: #d4d4d8; font-weight: 600; }     /* Keyword.Namespace */
.highlight .kt { color: #fbbf24; }                       /* Keyword.Type */
.highlight .nb { color: #93c5fd; }                       /* Name.Builtin */
.highlight .nc { color: #fbbf24; font-weight: 600; }     /* Name.Class */
.highlight .nf { color: #93c5fd; }                       /* Name.Function */
.highlight .nv { color: #d4d4d8; }                       /* Name.Variable */
.highlight .s2 { color: #86efac; }                       /* Literal.String.Double */
.highlight .se { color: #fca5a5; }                       /* String.Escape */
.highlight .si { color: #fbbf24; }                       /* String.Interpol */
.highlight .bp { color: #93c5fd; }                       /* Name.Builtin.Pseudo */
.highlight .ow { color: #d4d4d8; font-weight: 600; }     /* Operator.Word */
.highlight .cm { color: #6b7280; font-style: italic; }   /* Comment.Multiline */
.highlight .cp { color: #6b7280; }                       /* Comment.Preproc */
.highlight .c1 { color: #6b7280; font-style: italic; }   /* Comment.Single */
.highlight .cs { color: #6b7280; font-style: italic; }   /* Comment.Special */
.highlight .gh { color: #d4d4d8; font-weight: 600; }     /* Generic.Heading */
.highlight .gu { color: #a1a1aa; }                       /* Generic.Subheading */
.highlight .nd { color: #fbbf24; }                       /* Name.Decorator */
.highlight .ni { color: #93c5fd; }                       /* Name.Entity */
.highlight .ne { color: #fca5a5; }                       /* Name.Exception */
.highlight .no { color: #fbbf24; }                       /* Name.Constant */
.highlight .nl { color: #d4d4d8; }                       /* Name.Label */
.highlight .nn { color: #d4d4d8; }                       /* Name.Namespace */
.highlight .nt { color: #d4d4d8; font-weight: 600; }     /* Name.Tag */
.highlight .vc { color: #d4d4d8; }                       /* Name.Variable.Class */
.highlight .vg { color: #d4d4d8; }                       /* Name.Variable.Global */
.highlight .vi { color: #d4d4d8; }                       /* Name.Variable.Instance */
.highlight .il { color: #fbbf24; }                       /* Number.Integer.Long */
.highlight .err { color: #fca5a5; }                      /* Error */
.highlight .gd { color: #fca5a5; }                       /* Generic.Deleted */
.highlight .gi { color: #86efac; }                       /* Generic.Inserted */
.highlight .gr { color: #fca5a5; }                       /* Generic.Error */
.highlight .gt { color: #fca5a5; }                       /* Generic.Traceback */

.light .highlight { background: var(--color-code-bg); }
.light .highlight .c { color: #9ca3af; }
.light .highlight .k { color: #1f2937; }
.light .highlight .s, .highlight .s2 { color: #059669; }
.light .highlight .m, .highlight .kt { color: #d97706; }
.light .highlight .nb, .highlight .nf { color: #2563eb; }
.light .highlight .nc { color: #d97706; }

/* --- Account Page --- */
.account-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    animation: fadeInUp 0.3s ease;
}
.account-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-bright);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}
.account-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--color-text-bright);
}

/* Paste table */
.paste-table {
    display: flex;
    flex-direction: column;
}
.paste-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.8rem;
    transition: background 0.15s ease;
}
.paste-row:last-child { border-bottom: none; }
.paste-row:hover { background: var(--color-bg-hover); margin: 0 -0.5rem; padding: 0.6rem 0.5rem; border-radius: var(--radius-sm); }
.paste-row.expired { opacity: 0.45; }
.paste-row-id code { font-size: 0.78rem; }
.paste-row-syntax { color: var(--color-text-dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }
.paste-row-size, .paste-row-views, .paste-row-date { color: var(--color-text-dim); font-size: 0.75rem; }
.paste-row-burn { color: var(--color-warning); font-size: 0.65rem; text-transform: uppercase; font-weight: 700; }

@media (max-width: 640px) {
    .paste-row {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    .paste-row-syntax, .paste-row-size, .paste-row-views { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
