:root {
    --bg: #f7fafc;
    --bg-accent: #edf7fb;
    --surface: #ffffff;
    --surface-soft: #f9fbfc;
    --surface-strong: #ffffff;
    --text: #16212b;
    --muted: #5f7081;
    --line: #dce6ee;
    --line-strong: #c4d4df;
    --primary: #13b5ea;
    --primary-dark: #0b8db8;
    --primary-soft: #e8f7fd;
    --accent: #0f766e;
    --success-bg: #eaf8f2;
    --success-line: #b8e3ce;
    --shadow: 0 18px 50px rgba(17, 36, 53, 0.08);
    --hero-shadow: 0 30px 60px rgba(17, 36, 53, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top center, rgba(19, 181, 234, 0.12), transparent 28rem),
        linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 24%, #ffffff 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    min-height: 100vh;
    padding: 0.75rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.page-content {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.landing-layout {
    min-height: calc(100vh - 7.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card {
    padding: 1.75rem;
}

.landing-hero {
    margin: 0 auto 2rem;
    padding: 1.8rem 1rem 1.4rem;
    text-align: center;
}

.landing-title {
    font-size: clamp(2.7rem, 4.8vw, 5rem);
    line-height: 1.04;
    white-space: nowrap;
    background: linear-gradient(135deg, #16212b 0%, #13b5ea 48%, #0f766e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 10px 24px rgba(19, 181, 234, 0.12);
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--primary-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

h2 {
    margin: 0 0 0.85rem;
    font-size: 1.28rem;
    line-height: 1.2;
}

.hero-text,
.section-text,
.status-box p,
.feature-list,
.section-text,
.feature-list {
    color: var(--muted);
    line-height: 1.6;
}

.hero-text-wide {
    max-width: 720px;
    margin: 0.8rem auto 0;
    font-size: 0.98rem;
}

.hero-actions {
    margin-top: 1.6rem;
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
}

.button-hero {
    min-height: 3.6rem;
    padding: 1rem 1.9rem;
    font-size: 1.08rem;
    box-shadow: 0 18px 36px rgba(19, 181, 234, 0.22);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.82rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.button-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 24px rgba(19, 181, 234, 0.18);
}

.button-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.button-secondary:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    align-items: stretch;
}

.feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.9rem 1.7rem 1.8rem;
    border: 1px solid #d9e5ee;
    border-top: 4px solid #2bb2e882;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #fcfeff 100%);
    box-shadow: 0 8px 20px rgba(17, 36, 53, 0.045);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.feature-card .eyebrow {
    margin-bottom: 0.8rem;
    color: #087ea4;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
}

.feature-card h2 {
    margin-bottom: 0.9rem;
    font-size: 1.25rem;
    line-height: 1.32;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #23556c;
}

.feature-card .section-text {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.65;
}

.feature-card:hover {
    transform: translateY(-1px);
    border-color: #d1dee8;
    box-shadow: 0 12px 24px rgba(17, 36, 53, 0.06);
}

.feature-list {
    margin: 0;
    padding-left: 1.25rem;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
    align-items: center;
    min-height: calc(100vh - 10rem);
    padding: 2rem 0;
}

.auth-copy {
    max-width: 32rem;
}

.auth-title {
    font-size: clamp(2.1rem, 3.6vw, 3.2rem);
    line-height: 1.02;
    color: #23556c;
}

.auth-home-link {
    display: inline-flex;
    margin-top: 1.5rem;
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-home-link:hover {
    text-decoration: underline;
}

.auth-card {
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
}

.auth-error-text {
    margin: 1rem 0 0;
    color: #c13d3d;
    font-size: 0.84rem;
    line-height: 1.4;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.form-field {
    display: grid;
    gap: 0.45rem;
}

.form-field span {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: #fff;
    color: var(--text);
    font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: rgba(19, 181, 234, 0.9);
    box-shadow: 0 0 0 4px rgba(19, 181, 234, 0.12);
}

.workspace-layout {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    padding: 0.35rem 0 0;
    min-height: calc(100vh - 7.5rem);
}

.workspace-topbar {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
}

.workspace-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 2.5rem;
}

.workspace-copy {
    max-width: 42rem;
}

.workspace-title {
    margin-bottom: 0.55rem;
    font-size: clamp(2rem, 3.6vw, 3.05rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: #23556c;
}

.workspace-user-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-top: 0.35rem;
}

.workspace-user-greeting {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.workspace-user-actions .button {
    min-height: 2.2rem;
    padding: 0.48rem 0.95rem;
    font-size: 0.88rem;
    color: #4f6b7d;
}

.workspace-subtitle {
    max-width: 36rem;
    margin: 0;
    font-size: 0.96rem;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.workspace-card {
    padding: 1.45rem;
    border-radius: 1rem;
    border: 1px solid #d9e5ee;
    background: linear-gradient(180deg, #ffffff 0%, #fcfeff 100%);
    box-shadow: 0 8px 20px rgba(17, 36, 53, 0.045);
}

.workspace-card h2 {
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    line-height: 1.28;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #23556c;
}

.workspace-card .section-text {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.6;
}

.workspace-note-stack {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.workspace-note {
    padding: 0.85rem 0.95rem;
    border: 1px solid #e2ebf1;
    border-radius: 0.9rem;
    background: #f8fbfd;
}

.workspace-note-label {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6a7c8d;
}

.workspace-note-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.workspace-result-note {
    margin: 0.95rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.card-wide {
    grid-column: 1 / -1;
}

.status-box {
    padding: 1rem 1.05rem;
    border: 1px dashed #d6e2ea;
    border-radius: 1rem;
    background: #f8fbfd;
}

.status-stack {
    display: grid;
    gap: 0.8rem;
}

.status-success {
    border-style: solid;
    border-color: var(--success-line);
    background: var(--success-bg);
}

.status-error {
    border-style: solid;
    border-color: #efc0c0;
    background: #fff1f1;
}

.loader-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.05rem 1.1rem;
    border: 1px solid #d9e5ee;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.loader-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid rgba(19, 181, 234, 0.18);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-title {
    margin: 0 0 0.2rem;
    font-weight: 700;
    color: #23556c;
}

.site-footer {
    max-width: 1120px;
    width: 100%;
    margin: 1.5rem auto 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(220, 230, 238, 0.95);
}

.site-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.is-hidden {
    display: none;
}

button:disabled {
    opacity: 0.7;
    cursor: wait;
}

input[type="file"]:disabled {
    opacity: 0.65;
    cursor: wait;
    background: #f3f8fb;
}

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

@media (max-width: 860px) {
    .landing-grid,
    .auth-layout,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-layout {
        min-height: auto;
    }

    .workspace-main {
        display: block;
        min-height: auto;
    }

    .workspace-user-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .card-wide {
        grid-column: auto;
    }

    .landing-title {
        white-space: normal;
    }

    .landing-layout {
        min-height: auto;
        display: block;
    }
}
