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

:root {
    --bg-deep:       #06091a;
    --bg-mid:        #0b1229;
    --surface:       rgba(14, 22, 50, 0.72);
    --surface-hover: rgba(20, 32, 70, 0.85);
    --border:        rgba(59, 130, 246, 0.15);
    --border-focus:  rgba(59, 130, 246, 0.55);

    --blue-dim:      #1d3a72;
    --blue-mid:      #2563eb;
    --blue-bright:   #3b82f6;
    --blue-light:    #93c5fd;
    --blue-glow:     rgba(37, 99, 235, 0.28);

    --text-primary:  #e8f0ff;
    --text-secondary:#8ba4cc;
    --text-muted:    #4a6494;

    --error:         #f87171;
    --error-bg:      rgba(248, 113, 113, 0.08);

    --radius-sm:     6px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --radius-xl:     28px;

    --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Page shell ── */

.page-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    overflow: hidden;
}

.page-glow {
    display: none;
}

/* ── Card ── */

.card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 780px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3.5rem 3.5rem 3rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03) inset,
        0 4px 32px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(59, 130, 246, 0.08) inset;
}

/* ── Hero ── */

.hero {
    margin-bottom: 2rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue-bright);
    margin-bottom: 0.85rem;
}

.eyebrow::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: var(--blue-bright);
    border-radius: 2px;
}

.hero h2 {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 42ch;
}

/* ── Form ── */

.form-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.paste-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.paste-target {
    width: 100%;
    height: 150px;
    resize: none;
    background: rgba(6, 9, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    padding: 0.875rem 1rem;
    caret-color: var(--blue-bright);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    outline: none;
}

.paste-target::placeholder {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.paste-target:focus {
    border-color: var(--border-focus);
    background: rgba(10, 16, 40, 0.75);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 1px 8px rgba(0,0,0,0.3);
}

.paste-target:hover:not(:focus) {
    border-color: rgba(59, 130, 246, 0.28);
}

/* ── Loader ── */

.loader-wrapper {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.loader {
    width: 26px;
    height: 26px;
    border: 2.5px solid rgba(59, 130, 246, 0.15);
    border-top-color: var(--blue-bright);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

/* ── Error ── */

.error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.82rem;
    padding: 0.65rem 0.9rem;
    line-height: 1.5;
}

/* ── Result ── */

.result-block {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.result-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.info {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--blue-light);
    line-height: 1.1;
    filter: drop-shadow(0 0 18px rgba(59, 130, 246, 0.4));
}

/* ── Responsive ── */

@media (max-width: 480px) {
    .card {
        padding: 2rem 1.5rem 1.75rem;
        border-radius: var(--radius-lg);
    }

    .hero h2 {
        font-size: 1.35rem;
    }

    .info {
        font-size: 2.25rem;
    }
}
