:root {
    --mbip-blue: #0f7a5f;
    --mbip-blue-dark: #0b4f43;
    --mbip-cyan: #ff7a59;
    --mbip-gold: #f2b84b;
    --ink: #20231f;
    --muted: #6f756d;
    --surface: #ffffff;
    --line: #dfe6dc;
    --soft: #f6faf3;
    --success: #0f7a5f;
    --shadow: 0 18px 50px rgba(38, 54, 42, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.92)),
        radial-gradient(circle at 12% 12%, rgba(255, 122, 89, 0.16), transparent 28%),
        radial-gradient(circle at 88% 4%, rgba(242, 184, 75, 0.18), transparent 24%),
        linear-gradient(135deg, #fbfcf7 0%, #f0f7ed 42%, #ffffff 100%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-page::before,
.login-page::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background-image:
        linear-gradient(rgba(15, 122, 95, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 122, 95, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 26px rgba(38, 54, 42, 0.08);
}

.navbar-brand {
    letter-spacing: 0;
}

.brand-logo {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 8px 14px rgba(15, 122, 95, 0.18));
}

.user-summary {
    min-width: 0;
}

.btn {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 650;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    --bs-btn-bg: var(--mbip-blue);
    --bs-btn-border-color: var(--mbip-blue);
    --bs-btn-hover-bg: var(--mbip-blue-dark);
    --bs-btn-hover-border-color: var(--mbip-blue-dark);
    box-shadow: 0 12px 26px rgba(15, 122, 95, 0.2);
}

.btn-success {
    --bs-btn-bg: var(--success);
    --bs-btn-border-color: var(--success);
    box-shadow: 0 12px 24px rgba(22, 133, 93, 0.18);
}

.btn-success.is-copied {
    color: #123b2f;
    background: linear-gradient(135deg, #f2b84b, #fff0b8);
    border-color: #f2b84b;
    box-shadow: 0 0 0 0.28rem rgba(242, 184, 75, 0.24), 0 16px 30px rgba(242, 184, 75, 0.25);
    animation: copiedPop 0.42s ease both;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding-inline: 14px;
    color: #6e331f;
    background: linear-gradient(135deg, #fff7ea, #fff0e8);
    border: 1px solid rgba(255, 122, 89, 0.36);
    box-shadow: 0 10px 22px rgba(110, 51, 31, 0.08);
}

.btn-logout:hover,
.btn-logout:focus {
    color: #ffffff;
    background: linear-gradient(135deg, #ff7a59, #cc5b3d);
    border-color: #ff7a59;
    box-shadow: 0 14px 28px rgba(255, 122, 89, 0.22);
}

.page-hero {
    padding: 42px 0 24px;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: center;
}

.hero-copy {
    max-width: 760px;
}

.hero-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(2.2rem, 4vw, 4.6rem);
    font-weight: 850;
    line-height: 1.04;
}

.hero-copy p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    color: var(--mbip-blue-dark);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.hero-graphic {
    position: relative;
    min-height: 250px;
}

.hero-document,
.scan-document {
    position: absolute;
    background: #ffffff;
    border: 1px solid rgba(15, 122, 95, 0.18);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-document.front {
    inset: 18px 34px 8px 72px;
    padding: 28px 24px;
}

.hero-document.back {
    inset: 48px 84px 22px 22px;
    background: #eaf6fb;
    transform: rotate(-5deg);
}

.hero-highlight {
    width: 72%;
    height: 44px;
    margin: 18px 0;
    border: 2px solid var(--mbip-gold);
    background: rgba(245, 197, 66, 0.18);
    border-radius: 8px;
}

.doc-line {
    height: 10px;
    width: 68%;
    margin-bottom: 12px;
    background: #d7e7f0;
    border-radius: 999px;
}

.doc-line.wide {
    width: 88%;
}

.doc-line.short {
    width: 42%;
}

.doc-field {
    width: 62%;
    height: 48px;
    margin: 18px 0;
    background: #edf7fb;
    border: 1px solid #cce7f3;
    border-radius: 8px;
}

.scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    top: 16%;
    height: 26px;
    background: linear-gradient(180deg, rgba(255, 122, 89, 0), rgba(255, 122, 89, 0.35), rgba(242, 184, 75, 0.32), rgba(255, 122, 89, 0));
    animation: scanBeam 2.4s ease-in-out infinite;
}

.hero-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: #243528;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(38, 54, 42, 0.14);
    font-weight: 750;
}

.hero-chip.top {
    top: 10px;
    right: 0;
    animation: floatSoft 4s ease-in-out infinite;
}

.hero-chip.bottom {
    left: 22px;
    bottom: 10px;
    animation: floatSoft 4s ease-in-out 0.8s infinite;
}

.upload-card {
    max-width: 860px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(215, 227, 237, 0.9);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.usage-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    color: #375238;
    background: linear-gradient(90deg, #f0f9ef, #fff8e5);
    border: 1px solid #d8ead2;
    border-radius: 8px;
}

.usage-note i {
    color: var(--mbip-blue);
}

.drop-zone {
    position: relative;
    display: flex;
    min-height: 260px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
    border: 2px dashed #a9c9a3;
    border-radius: 8px;
    background:
        linear-gradient(#fbfdff, #fbfdff) padding-box,
        linear-gradient(135deg, rgba(15, 122, 95, 0.26), rgba(255, 122, 89, 0.22), rgba(242, 184, 75, 0.32)) border-box;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.drop-zone::after {
    position: absolute;
    inset: auto 18px 18px;
    height: 4px;
    content: "";
    background: linear-gradient(90deg, var(--mbip-blue), var(--mbip-cyan), var(--mbip-gold));
    border-radius: 999px;
    opacity: 0.55;
    transform: scaleX(0.35);
    transform-origin: left center;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
    border-color: var(--mbip-cyan);
    background: #f3fbef;
    box-shadow: 0 18px 36px rgba(15, 122, 95, 0.14);
    transform: translateY(-2px);
}

.drop-zone:hover::after,
.drop-zone.is-dragging::after {
    opacity: 1;
    transform: scaleX(1);
}

.drop-icon {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    color: var(--mbip-blue);
    background: #eaf7e7;
    border: 1px solid #cfe8c8;
    border-radius: 50%;
    font-size: 2.35rem;
    box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.72);
    animation: floatSoft 3.8s ease-in-out infinite;
}

.drop-title {
    font-size: 1.14rem;
    font-weight: 800;
}

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

.drop-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 10px;
    color: #6d4a10;
    background: #fff2cc;
    border: 1px solid #f4d46a;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding: 14px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    animation: riseIn 0.28s ease both;
}

.file-preview {
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--mbip-blue);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1.8rem;
}

.file-meta {
    min-width: 0;
    overflow-wrap: anywhere;
}

.result-shell {
    margin-top: 24px;
    animation: riseIn 0.34s ease both;
}

.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.result-head h1,
.result-head h2 {
    overflow-wrap: anywhere;
}

.tab-content {
    display: grid;
    gap: 18px;
}

@media (min-width: 992px) {
    .tab-content {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
        align-items: stretch;
    }

    .tab-content.document-only {
        grid-template-columns: minmax(0, 1fr);
    }

    .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }
}

.viewer-panel,
.text-panel {
    min-height: 72vh;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.panel-toolbar {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(90deg, #fcfefb, #f4fbef);
    border-bottom: 1px solid var(--line);
}

.panel-toolbar .btn {
    min-height: 34px;
}

.document-viewer {
    position: relative;
    display: flex;
    height: calc(72vh - 58px);
    min-height: 560px;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 22px;
    overflow: auto;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0)),
        repeating-linear-gradient(45deg, #e5eadf 0 16px, #dde6d8 16px 32px);
    cursor: crosshair;
}

.document-viewer canvas,
.document-viewer img {
    max-width: 100%;
    height: auto;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 14px 34px rgba(38, 54, 42, 0.2);
    transform-origin: top center;
    user-select: none;
}

.document-viewer.selection-disabled {
    cursor: default;
}

.selection-box {
    position: absolute;
    z-index: 5;
    border: 2px solid var(--mbip-gold);
    background: rgba(245, 197, 66, 0.22);
    box-shadow: 0 0 0 9999px rgba(8, 21, 34, 0.2), 0 0 0 4px rgba(245, 197, 66, 0.18);
    pointer-events: none;
}

.document-viewer:fullscreen {
    height: 100vh;
    padding: 24px;
}

.ocr-textarea {
    display: block;
    width: 100%;
    height: calc(72vh - 146px);
    min-height: 430px;
    padding: 18px;
    color: #111827;
    background: #ffffff;
    border: 0;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.98rem;
    line-height: 1.65;
    outline: none;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    background: #fbfdff;
    border-top: 1px solid var(--line);
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(18px, 3vw, 42px);
    background:
        radial-gradient(circle at 88% 10%, rgba(242, 184, 75, 0.2), transparent 26%),
        radial-gradient(circle at 8% 90%, rgba(15, 122, 95, 0.13), transparent 32%),
        linear-gradient(135deg, #f8fbf7 0%, #edf5ef 48%, #fbfaf4 100%);
    overflow-x: hidden;
}

.login-shell {
    position: relative;
    display: grid;
    width: min(1080px, 100%);
    grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
    gap: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(15, 122, 95, 0.12);
    border-radius: 28px;
    box-shadow: 0 32px 90px rgba(28, 60, 45, 0.18);
}

.login-visual {
    position: relative;
    min-height: 620px;
    padding: 42px 46px 34px;
    color: #ffffff;
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 122, 89, 0.3), transparent 22%),
        radial-gradient(circle at 88% 88%, rgba(242, 184, 75, 0.22), transparent 24%),
        linear-gradient(150deg, #108064 0%, #145c49 52%, #183d34 100%);
    overflow: hidden;
}

.login-visual::before {
    position: absolute;
    top: -150px;
    right: -130px;
    width: 340px;
    height: 340px;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 0 46px rgba(255, 255, 255, 0.025), 0 0 0 92px rgba(255, 255, 255, 0.018);
}

.login-visual::after {
    position: absolute;
    inset: 20px;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
}

.login-visual-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-visual-logo {
    width: 50px;
    height: 50px;
    border-radius: 13px;
}

.login-visual-brand div {
    display: grid;
    gap: 2px;
}

.login-visual-brand strong {
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.login-visual-brand span {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-visual-copy {
    position: relative;
    z-index: 1;
    max-width: 450px;
    margin-top: 40px;
}

.login-visual-copy h2 {
    margin: 16px 0 12px;
    font-size: clamp(2.2rem, 3.2vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.login-visual-copy h2 em {
    color: #f7ce70;
    font-style: normal;
}

.login-visual-copy p {
    max-width: 420px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.98rem;
    line-height: 1.65;
}

.login-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    color: #fff6da;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.scan-card {
    position: relative;
    z-index: 1;
    width: min(370px, 100%);
    margin: 28px auto 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(10, 35, 27, 0.22);
    backdrop-filter: blur(12px);
}

.scan-card::after {
    position: absolute;
    right: -18px;
    bottom: -18px;
    width: 96px;
    height: 96px;
    content: "";
    background: rgba(242, 184, 75, 0.24);
    border-radius: 50%;
    filter: blur(2px);
}

.scan-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 3px;
}

.scan-card-toolbar div {
    display: flex;
    gap: 6px;
}

.scan-card-toolbar span {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 50%;
}

.scan-card-toolbar small {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
    font-weight: 700;
}

.scan-document {
    position: relative;
    min-height: 210px;
    inset: auto;
    padding: 30px 26px;
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(7, 29, 22, 0.18);
}

.scan-status {
    position: absolute;
    right: 16px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    color: #12634f;
    background: #e7f7ef;
    border: 1px solid #c6eadb;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.login-visual-badges {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.login-visual-badges span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-weight: 750;
}

.login-card {
    display: flex;
    min-height: 520px;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 48px 52px 28px;
    text-align: left;
    background:
        radial-gradient(circle at 100% 0%, rgba(242, 184, 75, 0.09), transparent 28%),
        #ffffff;
}

.login-card-inner {
    width: 100%;
    max-width: 390px;
    margin: auto;
}

.login-brand-lockup {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 34px;
    border-bottom: 1px solid #e7eee9;
}

.login-brand-lockup div {
    display: grid;
    gap: 2px;
}

.login-brand-lockup span {
    color: #74827b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.login-brand-lockup strong {
    color: #183d34;
    font-size: 1.05rem;
    font-weight: 850;
}

.login-heading {
    margin: 36px 0 28px;
}

.login-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 13px;
    color: #3f6f5f;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.login-status i {
    color: #28a276;
    font-size: 0.5rem;
    box-shadow: 0 0 0 4px rgba(40, 162, 118, 0.1);
    border-radius: 50%;
}

.login-heading h1 {
    margin: 0 0 10px;
    color: #17241f;
    font-size: clamp(2rem, 3vw, 2.55rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-heading p {
    margin: 0;
    color: #66746e;
    font-size: 0.98rem;
    line-height: 1.65;
}

.login-form {
    display: grid;
}

.login-card .btn-primary {
    display: grid;
    min-height: 68px;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 15px 10px 12px;
    text-align: left;
    background: linear-gradient(135deg, #0f7a5f, #168d6d);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 30px rgba(15, 122, 95, 0.22);
}

.login-card .btn-primary:hover {
    background: linear-gradient(135deg, #0c684f, #0f7a5f);
    box-shadow: 0 20px 36px rgba(15, 122, 95, 0.3);
}

.login-button-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 11px;
    font-size: 1.15rem;
}

.login-button-copy {
    display: grid;
    gap: 1px;
}

.login-button-copy small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    font-weight: 650;
}

.login-button-copy strong {
    font-size: 1rem;
    font-weight: 800;
}

.login-button-arrow {
    font-size: 1.1rem;
}

.login-assurance {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 24px;
    padding: 14px 15px;
    color: #456258;
    background: #f5faf7;
    border: 1px solid #dfece5;
    border-radius: 12px;
}

.login-assurance > i {
    color: #13805f;
    font-size: 1.15rem;
}

.login-assurance div {
    display: grid;
    gap: 2px;
}

.login-assurance strong {
    color: #244a3d;
    font-size: 0.82rem;
}

.login-assurance span {
    color: #718078;
    font-size: 0.75rem;
    line-height: 1.45;
}

.login-footer {
    margin: 30px 0 0;
    color: #95a19b;
    font-size: 0.72rem;
    text-align: center;
}

.login-logo {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 14px;
    filter: drop-shadow(0 9px 14px rgba(15, 122, 95, 0.16));
}

.ocr-spinner {
    display: grid;
    width: 76px;
    height: 76px;
    place-items: center;
    margin-inline: auto;
    color: var(--mbip-blue);
    background: #eaf7e7;
    border-radius: 50%;
    font-size: 2.25rem;
    animation: pulseScan 1.2s ease-in-out infinite;
}

.loading-content,
.ocr-result-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 30px 70px rgba(15, 32, 48, 0.24);
}

.modal-backdrop.show {
    opacity: 0.62;
}

.modal-backdrop.show.ocr-result-backdrop {
    background-color: #141a16;
    opacity: 0.82;
    backdrop-filter: blur(2px);
}

.ocr-result-content .modal-header {
    background: linear-gradient(90deg, #f7fcf4, #fff7e6);
    border-bottom-color: var(--line);
}

.result-modal-hint {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    padding: 10px 12px;
    color: #24513f;
    background: #eefaf5;
    border: 1px solid #ccebdd;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 650;
}

.ocr-modal-textarea {
    display: block;
    width: 100%;
    min-height: 240px;
    padding: 14px;
    color: #111827;
    border: 1px solid var(--line);
    border-radius: 8px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
}

.ocr-modal-textarea:focus {
    border-color: var(--mbip-cyan);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 89, 0.16);
}

.progress {
    height: 24px;
    background: #e7eee3;
}

@keyframes pulseScan {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 122, 89, 0.42);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 14px rgba(255, 122, 89, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 122, 89, 0);
    }
}

@keyframes scanBeam {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    50% {
        transform: translateY(150px);
        opacity: 1;
    }
}

@keyframes floatSoft {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes copiedPop {
    0% {
        transform: scale(0.96);
    }
    55% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 991.98px) {
    .page-hero {
        padding-top: 28px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-graphic {
        min-height: 220px;
    }

    .upload-card {
        padding: 18px;
    }

    .result-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-head .btn {
        width: 100%;
    }

    .viewer-panel,
    .text-panel {
        min-height: auto;
    }

    .document-viewer,
    .ocr-textarea {
        height: 65vh;
        min-height: 340px;
    }

    .action-row .btn {
        flex: 1 1 100%;
    }

    .login-shell {
        width: min(680px, 100%);
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 390px;
        padding: 36px 42px 32px;
    }

    .login-visual-copy {
        max-width: 520px;
        margin-top: 28px;
    }

    .login-visual-copy h2 {
        font-size: 2.4rem;
    }

    .scan-card {
        display: none;
    }

    .login-card {
        min-height: 500px;
        padding: 42px 52px 28px;
    }
}

@media (max-width: 575.98px) {
    .user-summary {
        gap: 8px !important;
    }

    .user-summary .btn {
        padding-inline: 10px;
    }

    .hero-copy h1 {
        font-size: 2.25rem;
    }

    .hero-graphic {
        display: none;
    }

    .drop-zone {
        min-height: 220px;
        padding: 20px;
    }

    .file-info {
        align-items: flex-start;
    }

    .login-page {
        padding: 10px;
    }

    .login-shell {
        border-radius: 20px;
    }

    .login-visual {
        display: none;
    }

    .login-card {
        min-height: calc(100vh - 20px);
        padding: 28px 22px 20px;
    }

    .login-brand-lockup {
        padding-bottom: 26px;
    }

    .login-heading {
        margin: 30px 0 24px;
    }

    .login-heading h1 {
        font-size: 2.15rem;
    }

    .login-footer {
        margin-top: 26px;
    }
}

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