:root {
    color-scheme: light;
    --bg: #f3eee8;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-solid: #ffffff;
    --ink: #211d1a;
    --muted: #716963;
    --line: rgba(33, 29, 26, 0.12);
    --accent: #8a563e;
    --accent-dark: #68402f;
    --accent-soft: #f1e3da;
    --success: #2f7250;
    --danger: #a23f3f;
    --shadow: 0 24px 70px rgba(49, 37, 29, 0.11);
    --radius: 24px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 4%, rgba(255, 255, 255, 0.95), transparent 34rem),
        radial-gradient(circle at 90% 18%, rgba(207, 174, 154, 0.28), transparent 30rem),
        linear-gradient(145deg, #f6f2ed 0%, #eee6de 100%);
}

button,
input {
    font: inherit;
}

button,
label[for] {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
label[for]:focus-visible,
.drop-zone:focus-visible {
    outline: 3px solid rgba(138, 86, 62, 0.3);
    outline-offset: 3px;
}

.is-hidden {
    display: none !important;
}

.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-primary {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 10px 24px rgba(138, 86, 62, 0.2);
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-dark);
    box-shadow: 0 12px 28px rgba(104, 64, 47, 0.24);
}

.button-secondary {
    color: var(--ink);
    background: var(--surface-solid);
    border-color: var(--line);
}

.button-secondary:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
    background: #faf7f4;
    border-color: rgba(33, 29, 26, 0.2);
}

.button-ghost {
    color: var(--muted);
    background: transparent;
    border-color: var(--line);
}

.button-full {
    width: 100%;
}

.button-small {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 0.88rem;
}

.alert {
    padding: 13px 15px;
    border: 1px solid rgba(138, 86, 62, 0.2);
    border-radius: 14px;
    color: #68402f;
    background: #faf0e9;
    font-size: 0.9rem;
    line-height: 1.45;
}

.alert-error {
    color: #7e3030;
    border-color: rgba(162, 63, 63, 0.22);
    background: #fbecec;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 440px);
}

.login-card {
    padding: 42px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-card h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 7vw, 3.4rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.045em;
}

.login-copy {
    margin: 16px 0 26px;
    color: var(--muted);
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.login-form label {
    font-size: 0.86rem;
    font-weight: 750;
}

.login-form input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
}

.login-form input:focus {
    border-color: var(--accent);
}

.login-form .button {
    margin-top: 8px;
}

.privacy-note {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.brand-mark {
    position: relative;
    width: 60px;
    height: 34px;
    margin-bottom: 26px;
}

.brand-mark span {
    position: absolute;
    top: 0;
    width: 34px;
    height: 34px;
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.brand-mark span:first-child {
    left: 0;
}

.brand-mark span:last-child {
    right: 0;
}

.brand-mark-small {
    width: 36px;
    height: 22px;
    margin: 0;
}

.brand-mark-small span {
    width: 22px;
    height: 22px;
    border-width: 1.5px;
}

.app-shell {
    width: min(100%, 1180px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 28px;
}

.topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.network-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.network-state i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(47, 114, 80, 0.12);
}

.network-state.offline i {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(162, 63, 63, 0.12);
}

.content {
    padding: 72px 0 42px;
}

.hero {
    max-width: 760px;
    margin-bottom: 34px;
}

.hero h1 {
    max-width: 680px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 7vw, 5.8rem);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.hero > p:last-child {
    max-width: 690px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.65;
}

.upload-card,
.progress-card,
.file-section {
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.upload-card {
    padding: 18px;
}

.drop-zone {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 24px;
    border: 1.5px dashed rgba(138, 86, 62, 0.34);
    border-radius: 18px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(248, 242, 237, 0.72));
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone.dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(0.996);
}

.drop-zone > strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    font-weight: 500;
}

.drop-zone > p {
    margin: 9px 0 24px;
    color: var(--muted);
}

.upload-icon {
    position: relative;
    width: 62px;
    height: 62px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: var(--accent-soft);
}

.upload-icon::before,
.upload-icon::after,
.upload-icon span::before {
    content: "";
    position: absolute;
    left: 50%;
    background: var(--accent);
    transform: translateX(-50%);
}

.upload-icon::before {
    top: 18px;
    width: 2px;
    height: 24px;
}

.upload-icon::after {
    top: 17px;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
    background: transparent;
    transform: translateX(-50%) rotate(45deg);
}

.upload-icon span::before {
    bottom: 15px;
    width: 28px;
    height: 2px;
}

.picker-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-card > .alert {
    margin-top: 14px;
}

.selection-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 10px 4px;
}

.selection-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
}

.selection-summary > div,
.progress-stats > div {
    display: grid;
    gap: 5px;
}

.selection-summary span,
.progress-stats span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.selection-summary strong {
    font-size: 0.95rem;
}

.progress-card {
    margin-top: 22px;
    padding: 28px;
}

.progress-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.progress-heading > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.progress-heading span {
    color: var(--muted);
    font-weight: 700;
}

.progress-heading strong {
    font-size: 1.7rem;
}

.progress-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.overall-progress {
    height: 12px;
    margin: 18px 0 22px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9e1da;
}

.overall-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #bc8062);
    transition: width 180ms ease;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.progress-stats strong {
    font-size: 1.02rem;
}

.resume-note {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.file-section {
    margin-top: 22px;
    padding: 28px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 500;
}

.muted {
    color: var(--muted);
    font-size: 0.84rem;
}

.file-list {
    display: grid;
    gap: 9px;
}

.file-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.7);
}

.file-type {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.file-main {
    min-width: 0;
}

.file-name-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.file-name {
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.75rem;
}

.file-path {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-progress {
    height: 4px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #ebe4de;
}

.file-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 160ms ease;
}

.file-status {
    min-width: 100px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    text-align: right;
}

.file-row.status-done .file-type {
    color: var(--success);
    background: rgba(47, 114, 80, 0.1);
}

.file-row.status-done .file-progress i {
    background: var(--success);
}

.file-row.status-error {
    border-color: rgba(162, 63, 63, 0.24);
    background: rgba(251, 236, 236, 0.7);
}

.file-row.status-error .file-type,
.file-row.status-error .file-status {
    color: var(--danger);
}

footer {
    display: flex;
    justify-content: center;
    padding: 18px 0 38px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

@media (max-width: 780px) {
    .app-shell {
        padding: 0 16px;
    }

    .content {
        padding-top: 48px;
    }

    .hero h1 {
        font-size: clamp(3rem, 15vw, 4.5rem);
    }

    .selection-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .action-row {
        justify-content: flex-start;
    }

    .progress-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .login-card {
        padding: 30px 24px;
    }

    .topbar {
        min-height: 70px;
    }

    .network-state span,
    .brand > span:last-child {
        display: none;
    }

    .hero {
        margin-bottom: 26px;
    }

    .upload-card {
        padding: 10px;
    }

    .drop-zone {
        min-height: 300px;
        padding: 34px 16px;
    }

    .picker-actions,
    .action-row {
        width: 100%;
        flex-direction: column;
    }

    .picker-actions .button,
    .action-row .button {
        width: 100%;
    }

    .selection-panel {
        padding-inline: 4px;
    }

    .selection-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .progress-card,
    .file-section {
        padding: 20px 16px;
    }

    .progress-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .file-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .file-type {
        width: 38px;
        height: 38px;
    }

    .file-status {
        grid-column: 2;
        min-width: 0;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
