:root {
    --bg-1: #eef2ff;
    --bg-2: #f7f9ff;
    --text: #14213d;
    --muted: #5b6785;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 20px 60px rgba(79, 70, 229, 0.14);
    --card-bg: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] {
    --bg-1: #0b0e1a;
    --bg-2: #10142a;
    --text: #eef1fb;
    --muted: #97a1c4;
    --primary: #818cf8;
    --primary-dark: #a5b4fc;
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.14);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.14);
    --glass-bg: rgba(24, 27, 46, 0.55);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    --card-bg: rgba(24, 27, 46, 0.6);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100vh;
    margin: 0;
}

body {
    overflow-x: hidden;
    background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    transition: background 0.4s ease, color 0.4s ease;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--glass-border);
}

.aurora {
    position: fixed;
    z-index: -2;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
    animation: drift 18s ease-in-out infinite alternate;
}

.aurora-a {
    top: -220px;
    left: -180px;
    width: 560px;
    height: 560px;
    background: #818cf8;
}

.aurora-b {
    top: -100px;
    right: -160px;
    width: 480px;
    height: 480px;
    background: #f472b6;
    animation-delay: -6s;
}

.aurora-c {
    bottom: -220px;
    left: 30%;
    width: 520px;
    height: 520px;
    background: #34d399;
    animation-delay: -12s;
}

[data-theme="dark"] .aurora {
    opacity: 0.28;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.12);
    }
}

.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.025;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px min(6vw, 60px) 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #818cf8, #f472b6);
    color: white;
    font-family: "Space Grotesk", sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.brand-name {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 15px;
}

.theme-toggle {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    color: var(--text);
    transition: transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.07);
}

.page-container {
    width: min(100% - 32px, 900px);
    margin: 0 auto;
    padding: 50px 0 70px;
}

.hero {
    margin-bottom: 34px;
    text-align: center;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
}

.hero h1 {
    margin: 20px 0 15px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(34px, 5.2vw, 54px);
    line-height: 1.08;
    letter-spacing: -1.5px;
}

.gradient-text {
    background: linear-gradient(120deg, #818cf8, #f472b6, #34d399);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero>p {
    max-width: 560px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 16.5px;
    line-height: 1.7;
}

.converter-card {
    min-height: 385px;
    padding: 34px;
    border-radius: 26px;
    box-shadow: var(--glass-shadow);
}

.drop-zone {
    display: flex;
    min-height: 235px;
    padding: 32px;
    border: 2px dashed rgba(129, 140, 248, 0.4);
    border-radius: 20px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    background: rgba(129, 140, 248, 0.05);
    outline: none;
    transition: all 0.25s ease;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(129, 140, 248, 0.12);
    transform: translateY(-2px);
}

.upload-icon {
    display: grid;
    width: 66px;
    height: 66px;
    margin-bottom: 14px;
    border-radius: 18px;
    place-items: center;
    background: linear-gradient(135deg, #818cf8, #a5b4fc);
    color: white;
}

.drop-zone h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 20px;
}

.drop-subtitle {
    margin: 8px 0;
    color: var(--muted);
}

.drop-subtitle span {
    color: var(--primary);
    font-weight: 800;
}

.drop-zone small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    opacity: 0.8;
}

.selected-file {
    display: flex;
    margin-top: 16px;
    padding: 14px;
    border-radius: 16px;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
}

.file-left {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.pdf-file-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 11px;
    place-items: center;
    background: var(--danger-light);
    color: var(--danger);
    font-size: 11px;
    font-weight: 800;
}

.file-details {
    min-width: 0;
}

.file-name {
    max-width: 480px;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.remove-file-button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 26px;
    line-height: 1;
}

.remove-file-button:hover {
    background: rgba(129, 140, 248, 0.15);
}

.primary-button,
.secondary-button {
    display: flex;
    width: 100%;
    margin-top: 20px;
    padding: 15px 20px;
    border: 0;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s ease;
}

.primary-button {
    background: linear-gradient(120deg, #6366f1, #a855f7);
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.35);
    color: white;
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.42);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

.secondary-button {
    background: rgba(129, 140, 248, 0.12);
    color: var(--primary-dark);
}

.secondary-button:hover {
    background: rgba(129, 140, 248, 0.2);
}

.processing-heading {
    display: flex;
    padding: 6px 0 22px;
    align-items: center;
    gap: 15px;
}

.processing-heading h2 {
    margin: 0 0 6px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 20px;
}

.processing-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.spinner {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 4px solid rgba(129, 140, 248, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.15);
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    transition: width 0.35s ease;
}

.progress-container span {
    min-width: 40px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
}

.conversion-stages {
    display: grid;
    margin-top: 26px;
    gap: 10px;
}

.stage {
    display: flex;
    padding: 13px 15px;
    border-radius: 13px;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    background: rgba(129, 140, 248, 0.04);
    transition: all 0.25s ease;
}

.stage-icon {
    display: grid;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    place-items: center;
    background: rgba(129, 140, 248, 0.15);
    color: var(--muted);
    font-size: 12px;
}

.stage.active {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stage.active .stage-icon {
    background: var(--primary);
    color: white;
}

.stage.complete {
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
}

.stage.complete .stage-icon {
    background: var(--success);
    color: white;
}

.result-section {
    padding: 12px 4px;
    text-align: center;
}

.success-check,
.error-symbol {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    place-items: center;
    font-size: 34px;
    font-weight: 800;
}

.success-check {
    background: var(--success-light);
    color: var(--success);
}

.error-symbol {
    background: var(--danger-light);
    color: var(--danger);
}

.result-section h2 {
    margin: 0 0 10px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 24px;
}

.result-description {
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.65;
}

.accuracy-card {
    display: flex;
    margin: 24px 0 12px;
    padding: 18px;
    border-radius: 16px;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.accuracy-card p {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 13px;
}

.accuracy-card h3 {
    margin: 0;
    color: var(--success);
    font-size: 19px;
}

.quality-score {
    display: grid;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    place-items: center;
    background: var(--success);
    color: white;
    font-size: 15px;
    font-weight: 800;
}

.quality-message {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    text-align: left;
}

.download-button {
    margin-top: 22px;
}

.features {
    display: grid;
    margin-top: 24px;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.feature-card {
    padding: 20px;
    border-radius: 18px;
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
    border-radius: 11px;
    place-items: center;
    background: linear-gradient(135deg, #818cf8, #f472b6);
    color: white;
    font-weight: 800;
}

.feature-card h3 {
    margin: 0 0 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 15px;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.notice {
    margin-top: 22px;
    padding: 20px;
    border-radius: 16px;
}

.notice h2 {
    margin: 0 0 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 15px;
}

.notice p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

@media (max-width: 700px) {
    .top-bar {
        padding: 18px 16px 0;
    }

    .page-container {
        padding: 34px 0 50px;
    }

    .converter-card {
        padding: 20px;
        border-radius: 20px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        letter-spacing: -0.8px;
    }

    .file-name {
        max-width: 180px;
    }
}
