:root {
    --bg: #f5f7fb;
    --bg-soft: #eef4ff;
    --card: #ffffff;
    --text: #12213a;
    --muted: #667085;
    --line: #dfe6f0;
    --line-strong: #cbd5e1;
    --primary: #155eef;
    --primary-dark: #0d46c7;
    --primary-soft: #eef4ff;
    --navy: #082f63;
    --navy-dark: #071b36;
    --danger: #b42318;
    --success: #067647;
    --warning: #b54708;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-md: 0 18px 50px rgba(15, 23, 42, .10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(21, 94, 239, .07), transparent 28rem),
        linear-gradient(180deg, #fbfcfe 0%, var(--bg) 60%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

h2 {
    font-size: 1.2rem;
    letter-spacing: -.015em;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(203, 213, 225, .75);
    backdrop-filter: blur(14px);
}

.topbar-inner {
    width: min(1440px, 92vw);
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.brand-logo {
    display: block;
    width: clamp(220px, 22vw, 330px);
    height: 54px;
    object-fit: contain;
    object-position: left center;
}

.topbar-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    white-space: nowrap;
}

.user-chip {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--navy);
    font-size: .85rem;
    font-weight: 750;
}

.topbar-link,
.topbar-logout,
.topbar-login {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 750;
    transition: .18s ease;
}

.topbar-link {
    color: var(--navy);
}

.topbar-link:hover {
    background: #f1f5f9;
}

.topbar-logout {
    color: #9b1c1c;
    background: #fff5f5;
}

.topbar-logout:hover {
    background: #fee4e2;
}

.topbar-login {
    color: white;
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(21, 94, 239, .18);
}

.topbar-login:hover {
    background: var(--primary-dark);
}

.container {
    width: min(1440px, 92vw);
    margin: 34px auto;
    min-height: calc(100vh - 190px);
}

.footer {
    padding: 22px 0 34px;
    color: var(--muted);
    font-size: .86rem;
}

.footer-inner {
    width: min(1440px, 92vw);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    gap: clamp(36px, 7vw, 100px);
    align-items: center;
    padding: clamp(36px, 6vw, 82px) 0 58px;
}

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--primary);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .16em;
}

.hero-copy h1 {
    margin-bottom: 22px;
    color: var(--navy-dark);
}

.hero-lead {
    max-width: 740px;
    margin-bottom: 28px;
    color: #526176;
    font-size: clamp(1rem, 1.5vw, 1.17rem);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.hero-trust {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .88rem;
}

.trust-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(6, 118, 71, .10);
}

.workflow-card {
    padding: 26px;
    border: 1px solid rgba(203, 213, 225, .8);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
    box-shadow: var(--shadow-md);
}

.workflow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.workflow-badge {
    color: var(--navy);
    font-size: .9rem;
    font-weight: 850;
}

.workflow-status {
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: var(--success);
    font-size: .75rem;
    font-weight: 850;
}

.workflow-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.workflow-step strong {
    display: block;
    margin-bottom: 5px;
    color: var(--navy-dark);
}

.workflow-step p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
}

.step-number {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(145deg, var(--navy), var(--primary));
    font-weight: 850;
}

.workflow-line {
    width: 2px;
    height: 24px;
    margin: 7px 0 7px 18px;
    background: linear-gradient(var(--primary-soft), #c7d7fe);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 46px;
}

.feature-card {
    min-height: 230px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.9);
    box-shadow: var(--shadow-sm);
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 20px;
    border-radius: 13px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: .82rem;
    font-weight: 900;
}

.feature-card h2 {
    margin-bottom: 11px;
    color: var(--navy-dark);
}

.feature-card p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.7;
}

.private-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: clamp(26px, 4vw, 42px);
    border-radius: 24px;
    color: white;
    background:
        radial-gradient(circle at 85% 0%, rgba(21,94,239,.65), transparent 26rem),
        linear-gradient(135deg, var(--navy-dark), var(--navy));
    box-shadow: var(--shadow-md);
}

.private-banner h2 {
    max-width: 760px;
    margin-bottom: 0;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.35;
}

.eyebrow-light {
    color: #b9d4ff;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 24px;
}

.page-heading h1 {
    margin-bottom: 9px;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
}

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

.card {
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.auth-card {
    width: min(520px, 100%);
    margin: clamp(40px, 8vh, 90px) auto;
    background: rgba(255,255,255,.98);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(28px, 5vw, 42px);
    box-shadow: var(--shadow-md);
}

.auth-card h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.auth-card p {
    color: var(--muted);
    line-height: 1.65;
}

.form-grid {
    display: grid;
    gap: 18px;
}

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

.form-grid label {
    display: grid;
    gap: 8px;
    color: #253550;
    font-weight: 720;
}

.full {
    grid-column: 1 / -1;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 12px 13px;
    color: var(--text);
    background: white;
    transition: border-color .16s ease, box-shadow .16s ease;
}

textarea {
    resize: vertical;
    line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(21, 94, 239, .12);
}

.upload-box {
    border: 2px dashed #b9c8dc;
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(180deg, #fbfdff, #f4f8ff);
}

.upload-box span {
    color: var(--muted);
    font-weight: 450;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    padding: 10px 16px;
    background: white;
    color: var(--text);
    cursor: pointer;
    font-weight: 780;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.btn:hover {
    transform: translateY(-1px);
    background: #f8fafc;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2c78ff);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 10px 22px rgba(21, 94, 239, .18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-light {
    color: var(--navy);
    background: white;
    border-color: white;
}

.btn-large {
    min-height: 50px;
    padding: 0 21px;
}

.btn-small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: .86rem;
}

.btn-block {
    width: 100%;
    margin-top: 16px;
}

.btn:disabled {
    opacity: .52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.alert {
    border-radius: 13px;
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.alert-error {
    background: #fef3f2;
    color: #912018;
    border: 1px solid #fecdca;
}

.alert-success {
    background: #ecfdf3;
    color: #05603a;
    border: 1px solid #abefc6;
}

.alert-info {
    background: #eff8ff;
    color: #175cd3;
    border: 1px solid #b2ddff;
}

.table-wrap {
    overflow-x: auto;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 19px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    background: #fbfcfe;
    font-size: .8rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

tbody tr {
    transition: background .14s ease;
}

tbody tr:hover {
    background: #f8fbff;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.status-pendiente {
    background: #f2f4f7;
    color: #475467;
}

.status-procesando {
    background: #fffaeb;
    color: var(--warning);
}

.status-completada {
    background: #ecfdf3;
    color: var(--success);
}

.status-error {
    background: #fef3f2;
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: clamp(52px, 8vw, 86px) 20px;
    background: rgba(255,255,255,.96);
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.empty-state h2 {
    margin-bottom: 10px;
    font-size: 1.45rem;
}

.empty-state p {
    color: var(--muted);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 18px;
}

.meta-grid > div {
    min-height: 88px;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .04);
}

.meta-grid span {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 650;
    margin-bottom: 7px;
}

.meta-grid strong {
    word-break: break-word;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.audio-panel {
    position: sticky;
    top: 94px;
}

audio {
    width: 100%;
    margin: 10px 0 15px;
}

.audio-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.privacy-note {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.55;
    margin: 16px 0 0;
}

.editor-panel textarea,
.acta-card textarea {
    min-height: 560px;
    padding: 16px;
    border-color: #c9d4e3;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: .94rem;
    background: #fcfdff;
}

.editor-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 13px;
}

.editor-heading small,
.editor-heading p {
    color: var(--muted);
}

.acta-card {
    margin-top: 18px;
}

.inline-form {
    margin-bottom: 14px;
}

.actions-inline {
    display: flex;
    gap: 8px;
}

.danger-zone {
    margin-top: 18px;
    border-color: #fecdca;
    background: #fffafa;
}

.danger-zone p {
    color: var(--muted);
}

@media (max-width: 1050px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .workflow-card {
        max-width: 700px;
    }

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

    .feature-card {
        min-height: auto;
    }

    .topbar-link {
        display: none;
    }
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .audio-panel {
        position: static;
    }

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

    .private-banner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .topbar-inner {
        width: min(94vw, 100%);
        min-height: 68px;
        gap: 10px;
    }

    .brand-logo {
        width: 205px;
        height: 45px;
    }

    .user-chip {
        display: none;
    }

    .topbar-nav {
        gap: 7px;
    }

    .topbar-logout,
    .topbar-login {
        min-height: 37px;
        padding: 0 11px;
        font-size: .82rem;
    }

    .container {
        width: min(94vw, 100%);
        margin-top: 22px;
    }

    .landing-hero {
        padding-top: 24px;
    }

    .page-heading,
    .editor-heading {
        flex-direction: column;
    }

    .form-two {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

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

    .hero-actions .btn {
        width: 100%;
    }

    .footer-inner {
        width: min(94vw, 100%);
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .brand-logo {
        width: 170px;
    }

    .workflow-card,
    .card,
    .auth-card {
        border-radius: 17px;
    }

    .audio-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}
