:root {
    --bg: #080b12;
    --bg-soft: #0d111a;
    --card: #111722;
    --card-hover: #151d2a;
    --border: #202a39;
    --accent: #5ca8ff;
    --accent-hover: #78b7ff;
    --success: #35d07f;
    --warning: #ffb84d;
    --danger: #ff5d6c;
    --text: #f2f5f8;
    --muted: #9ca8b8;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}


/* =========================
   HEADER
========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background:
        rgba(8, 11, 18, 0.92);

    border-bottom:
        1px solid var(--border);

    backdrop-filter:
        blur(14px);
}

.header-inner {
    width:
        min(
            1100px,
            calc(100% - 32px)
        );

    min-height: 68px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    color: var(--text);

    text-decoration: none;

    font-weight: 800;
    font-size: 1rem;
}

.brand-symbol {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--card);

    color: var(--accent);

    font-size: 1.15rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding:
        8px 15px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background: var(--card);
    color: var(--text);

    text-decoration: none;

    font-size: 0.9rem;
    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.back-button:hover {
    background: var(--card-hover);

    border-color:
        var(--accent);

    transform:
        translateY(-1px);
}


/* =========================
   MAIN
========================= */

main {
    width:
        min(
            1000px,
            calc(100% - 32px)
        );

    margin: 0 auto;
}


/* =========================
   HERO
========================= */

.hero {
    padding:
        64px 0 42px;

    text-align: center;
}

.hero-icon {
    width: 76px;
    height: 76px;

    margin:
        0 auto 20px;

    display: grid;
    place-items: center;

    border:
        1px solid var(--border);

    border-radius: 22px;

    background:
        var(--card);

    box-shadow:
        var(--shadow);

    font-size: 2.3rem;
}

.hero h1 {
    margin-bottom: 12px;

    font-size:
        clamp(
            2rem,
            6vw,
            3.1rem
        );

    line-height: 1.1;

    letter-spacing:
        -0.03em;
}

.hero > p {
    max-width: 680px;

    margin:
        0 auto;

    color: var(--muted);

    font-size: 1rem;
}

.privacy-note {
    width: fit-content;
    max-width: 100%;

    margin:
        22px auto 0;

    padding:
        10px 15px;

    border:
        1px solid
        rgba(
            53,
            208,
            127,
            0.25
        );

    border-radius: 12px;

    background:
        rgba(
            53,
            208,
            127,
            0.06
        );

    color: #b8eecf;

    font-size: 0.86rem;
}


/* =========================
   TOOL SECTIONS
========================= */

.tool-section {
    margin-bottom: 24px;

    padding: 24px;

    border:
        1px solid var(--border);

    border-radius: 18px;

    background:
        var(--card);

    box-shadow:
        0 8px 28px
        rgba(
            0,
            0,
            0,
            0.16
        );
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 20px;
}

.section-heading h2 {
    margin-bottom: 3px;

    font-size: 1.2rem;
}

.section-heading p {
    color: var(--muted);

    font-size: 0.88rem;
}


/* =========================
   MODE SWITCHER
========================= */

.mode-switcher {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px;
}

.mode-button {
    min-height: 54px;

    padding:
        10px 14px;

    border:
        1px solid var(--border);

    border-radius: 12px;

    background:
        var(--bg-soft);

    color: var(--muted);

    cursor: pointer;

    font: inherit;
    font-weight: 750;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.mode-button:hover {
    border-color:
        var(--accent);

    color:
        var(--text);
}

.mode-button.active {
    border-color:
        var(--accent);

    background:
        rgba(
            124,
            92,
            255,
            0.13
        );

    color:
        var(--text);

    box-shadow:
        inset 0 0 0 1px
        rgba(
            124,
            92,
            255,
            0.12
        );
}


/* =========================
   DROP AREA
========================= */

.drop-area {
    padding:
        44px 22px;

    border:
        2px dashed var(--border);

    border-radius: 16px;

    text-align: center;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.drop-area.drag-over {
    border-color:
        var(--accent);

    background:
        rgba(
            124,
            92,
            255,
            0.07
        );

    transform:
        scale(1.005);
}

.upload-icon {
    margin-bottom: 14px;

    font-size: 2.5rem;
}

.drop-area h2 {
    margin-bottom: 6px;

    font-size: 1.25rem;
}

.drop-area p {
    color: var(--muted);
}

.upload-hint {
    margin-top: 13px;

    font-size: 0.8rem;
}


/* =========================
   BUTTONS
========================= */

button {
    font: inherit;
}

.primary-button,
.secondary-button {
    min-height: 44px;

    padding:
        9px 17px;

    border-radius: 11px;

    cursor: pointer;

    font-weight: 700;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.primary-button {
    border:
        1px solid var(--accent);

    background:
        var(--accent);

    color: white;
}

.primary-button:hover:not(:disabled) {
    background:
        var(--accent-hover);

    transform:
        translateY(-1px);
}

.secondary-button {
    border:
        1px solid var(--border);

    background:
        var(--bg-soft);

    color:
        var(--text);
}

.secondary-button:hover:not(:disabled) {
    border-color:
        var(--accent);

    background:
        var(--card-hover);
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor:
        not-allowed;

    opacity:
        0.45;
}

.action-button {
    width: 100%;

    min-height: 52px;

    margin-top: 24px;

    font-size: 1rem;
}


/* =========================
   PDF CARD
========================= */

.pdf-card {
    display: flex;
    align-items: center;

    gap: 16px;

    padding: 18px;

    border:
        1px solid var(--border);

    border-radius: 14px;

    background:
        var(--bg-soft);
}

.pdf-card-icon {
    flex:
        0 0 auto;

    width: 52px;
    height: 52px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background:
        rgba(
            124,
            92,
            255,
            0.1
        );

    font-size: 1.6rem;
}

.pdf-card-info {
    min-width: 0;
}

.pdf-card-info h3 {
    overflow: hidden;

    margin-bottom: 2px;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 0.98rem;
}

.pdf-card-info p {
    color:
        var(--muted);

    font-size:
        0.82rem;
}

#pdfStatus {
    margin-top: 3px;

    color:
        var(--success);
}


/* =========================
   PASSWORD
========================= */

.password-box {
    max-width: 700px;

    margin-bottom: 22px;
}

.password-box label {
    display: block;

    margin-bottom: 8px;

    font-size: 0.9rem;

    font-weight: 700;
}

.password-input-row {
    display: flex;

    gap: 10px;
}

.password-input-row input {
    flex: 1;

    min-width: 0;

    height: 46px;

    padding:
        0 14px;

    border:
        1px solid var(--border);

    border-radius: 11px;

    outline: none;

    background:
        var(--bg-soft);

    color:
        var(--text);

    font-size:
        0.95rem;

    transition:
        border-color 0.2s ease;
}

.password-input-row input:focus {
    border-color:
        var(--accent);
}

.password-input-row input::placeholder {
    color:
        #687386;
}

.input-hint {
    margin-top: 9px;

    color:
        var(--muted);

    font-size:
        0.8rem;
}


/* =========================
   CHECKBOX CARDS
========================= */

.unlock-options {
    margin-top: 8px;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 15px;

    border:
        1px solid var(--border);

    border-radius: 13px;

    background:
        var(--bg-soft);

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.checkbox-card:hover {
    border-color:
        var(--accent);

    background:
        var(--card-hover);
}

.checkbox-card input {
    flex:
        0 0 auto;

    width: 19px;
    height: 19px;

    margin-top: 2px;

    accent-color:
        var(--accent);

    cursor: pointer;
}

.checkbox-card span {
    display: flex;

    flex-direction: column;

    gap: 2px;
}

.checkbox-card strong {
    font-size:
        0.9rem;
}

.checkbox-card small {
    color:
        var(--muted);

    font-size:
        0.78rem;
}


/* =========================
   SETTINGS
========================= */

.settings-group {
    margin-top: 26px;
}

.settings-group h3 {
    margin-bottom: 5px;

    font-size:
        1rem;
}

.settings-description {
    margin-bottom: 14px;

    color:
        var(--muted);

    font-size:
        0.83rem;
}

.select-label {
    display: block;

    margin:
        12px 0 8px;

    color:
        var(--muted);

    font-size:
        0.82rem;
}

.settings-select {
    width: 100%;

    height: 46px;

    padding:
        0 13px;

    border:
        1px solid var(--border);

    border-radius: 11px;

    outline: none;

    background:
        var(--bg-soft);

    color:
        var(--text);

    font: inherit;

    cursor: pointer;
}

.settings-select:focus {
    border-color:
        var(--accent);
}

.permission-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 12px;
}


/* =========================
   PROGRESS
========================= */

.progress-box {
    padding: 4px 0;
}

.progress-header {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 10px;

    color:
        var(--muted);

    font-size:
        0.85rem;
}

.progress-track {
    width: 100%;

    height: 10px;

    overflow: hidden;

    border-radius:
        999px;

    background:
        var(--bg-soft);
}

.progress-bar {
    width: 0;

    height: 100%;

    border-radius:
        inherit;

    background:
        var(--accent);

    transition:
        width 0.25s ease;
}


/* =========================
   RESULT
========================= */

.result-section {
    text-align: center;

    border-color:
        rgba(
            53,
            208,
            127,
            0.3
        );

    background:
        rgba(
            53,
            208,
            127,
            0.045
        );
}

.result-icon {
    margin-bottom: 8px;

    font-size: 2.2rem;
}

.result-section h2 {
    margin-bottom: 5px;
}

.result-section p {
    margin-bottom: 20px;

    color:
        var(--muted);
}


/* =========================
   INFORMATION
========================= */

.info-section {
    margin:
        46px 0 24px;
}

.info-section > h2 {
    margin-bottom: 18px;

    font-size:
        1.35rem;
}

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 16px;
}

.info-card {
    padding: 20px;

    border:
        1px solid var(--border);

    border-radius: 15px;

    background:
        var(--card);
}

.info-card-icon {
    margin-bottom: 10px;

    font-size:
        1.6rem;
}

.info-card h3 {
    margin-bottom: 7px;

    font-size:
        0.98rem;
}

.info-card p {
    color:
        var(--muted);

    font-size:
        0.84rem;
}


/* =========================
   WARNING
========================= */

.warning-section {
    margin-bottom: 45px;

    padding: 20px;

    border:
        1px solid
        rgba(
            255,
            184,
            77,
            0.25
        );

    border-radius: 15px;

    background:
        rgba(
            255,
            184,
            77,
            0.045
        );
}

.warning-section h2 {
    margin-bottom: 6px;

    color:
        var(--warning);

    font-size:
        1rem;
}

.warning-section p {
    color:
        var(--muted);

    font-size:
        0.84rem;
}


/* =========================
   FOOTER
========================= */

.site-footer {
    padding:
        28px 16px 35px;

    border-top:
        1px solid var(--border);

    text-align: center;

    color:
        var(--muted);

    font-size:
        0.78rem;
}

.site-footer p + p {
    margin-top: 3px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 760px) {

    .hero {
        padding:
            48px 0 32px;
    }

    .tool-section {
        padding:
            18px;
    }

    .info-grid {
        grid-template-columns:
            1fr;
    }

    .permission-grid {
        grid-template-columns:
            1fr;
    }

    .section-heading {
        align-items:
            flex-start;
    }
}


@media (max-width: 520px) {

    main {
        width:
            min(
                100% - 20px,
                1000px
            );
    }

    .header-inner {
        width:
            calc(100% - 20px);

        min-height:
            62px;
    }

    .brand {
        font-size:
            0.9rem;
    }

    .brand-symbol {
        width: 31px;
        height: 31px;
    }

    .back-button {
        min-height:
            38px;

        padding:
            7px 12px;

        font-size:
            0.82rem;
    }

    .hero {
        padding-top:
            38px;
    }

    .hero-icon {
        width: 66px;
        height: 66px;

        border-radius:
            19px;

        font-size:
            2rem;
    }

    .hero h1 {
        font-size:
            2rem;
    }

    .hero > p {
        font-size:
            0.9rem;
    }

    .privacy-note {
        font-size:
            0.78rem;
    }

    .mode-switcher {
        grid-template-columns:
            1fr;
    }

    .drop-area {
        padding:
            35px 15px;
    }

    .password-input-row {
        flex-direction:
            column;
    }

    .password-input-row
    .secondary-button {
        width:
            100%;
    }

    .pdf-card {
        align-items:
            flex-start;
    }

    .section-heading {
        flex-direction:
            column;
    }

    .section-heading
    .secondary-button {
        width:
            100%;
    }

    .result-section
    .primary-button {
        width:
            100%;
    }

}