:root {
    --bg-body: #ffffff;
    --bg-surface: #f8fafc;
    --bg-hover: #f1f5f9;
    --bg-presionado: #e2e8f0;
    --bg-deshabilitado: #f1f5f9;
    --bg-brand: var(--brand-600);
    --bg-error: #fef2f2;
    --text-default: #334155;
    --text-subtle: #64748b;
    --text-strong: #020617;
    --text-disabled: #cbd5e1;
    --text-onColor: #ffffff;
    --text-error: #dc2626;
    --text-brand: var(--brand-600);
    --border-default: #e2e8f0;
    --border-focus: #94a3b8;
    --border-error: #dc2626;
    --brand-50: #f5f8fa;
    --brand-100: #eaf2f6;
    --brand-600: #00a3e0;
    --brand-700: #077ba6;
    --brand-800: #085978;
    --radius-none: 0px;
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
    --spacing-none: 0px;
    --spacing-xxs: 4px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 40px;
    --spacing-4xl: 48px;
    --spacing-5xl: 64px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --auth-panel-width: 540px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: var(--spacing-none);
    color: var(--text-default);
    font-family: "Figtree", sans-serif;
    background: var(--bg-body);
}

button,
input {
    font: inherit;
}

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

.auth-shell {
    display: grid;
    grid-template-columns: var(--auth-panel-width) minmax(0, 1fr);
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg-body);
}

.auth-panel {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-4xl);
    overflow: hidden;
    background: var(--bg-body);
    border-radius: var(--radius-none) var(--radius-xl) var(--radius-xl) var(--radius-none);
}

.auth-panel::before {
    position: absolute;
    bottom: -118px;
    left: -191px;
    width: 600px;
    height: 600px;
    background-image: url('/assets/auth/gasco-blanco.svg');
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: contain;
    content: "";
    pointer-events: none;
}

.auth-panel::after {
    content: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, 444px);
}

.auth-logo {
    display: block;
    width: 260px;
    height: auto;
    margin: var(--spacing-none) auto var(--spacing-2xl);
}

.auth-header {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

.auth-header h1 {
    margin: var(--spacing-none);
    color: var(--text-default);
    font-size: 28px;
    font-weight: 600;
    line-height: 32px;
}

.auth-header p {
    max-width: 430px;
    margin: var(--spacing-xs) auto var(--spacing-none);
    color: var(--text-subtle);
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
}

.auth-form {
    display: grid;
    gap: var(--spacing-md);
}

.field-group {
    display: grid;
    gap: var(--spacing-xs);
}

.field-group label {
    color: var(--text-default);
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
}

.input-wrap {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 42px;
    padding: var(--spacing-none) var(--spacing-sm);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.input-wrap:hover {
    box-shadow: var(--shadow-sm);
}

.input-wrap:focus-within {
    border-color: var(--border-focus);
}

.input-wrap.is-invalid {
    border-color: var(--border-error);
}

.input-wrap input {
    width: 100%;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: 0;
    color: var(--text-default);
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
}

.input-wrap input::placeholder {
    color: var(--text-subtle);
}

.input-icon,
.status-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
}

.status-icon {
    color: var(--text-error);
}

.input-icon-button {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.input-icon-button:hover {
    color: var(--text-default);
}

.input-icon svg,
.input-icon i,
.status-icon svg,
.status-icon i,
.btn i,
.btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: currentColor;
    font-size: 18px;
}

.input-icon svg,
.status-icon svg,
.btn svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.field-error {
    margin: calc(var(--spacing-xs) * -1) var(--spacing-none) var(--spacing-none);
    color: var(--text-error);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.auth-message:empty {
    display: none;
}

.notice {
    padding: var(--spacing-sm);
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    color: #166534;
    background: #f0fdf4;
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.action-stack {
    display: grid;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-lg);
}

.btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn-primary {
    color: var(--text-onColor);
    background: var(--bg-brand);
}

.btn-primary:hover {
    background: var(--brand-700);
}

.btn-primary:active {
    background: var(--brand-800);
}

.btn-secondary {
    color: var(--text-brand);
    background: var(--bg-body);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-secondary:active {
    background: var(--bg-presionado);
}

.auth-visual {
    min-height: 100vh;
    background-image: url("/assets/auth/gasco-plant.png?v=20260708-1015");
    background-position: center;
    background-size: cover;
}

.code-fieldset {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: var(--spacing-sm);
    padding: var(--spacing-none);
    margin: var(--spacing-none);
    border: 0;
}

.code-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    outline: 0;
    color: var(--text-default);
    background: var(--bg-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    text-align: center;
}

.code-input::placeholder {
    color: var(--text-subtle);
}

.code-input:focus {
    border-color: var(--border-focus);
}

.password-rules {
    display: grid;
    gap: var(--spacing-xs);
    padding-top: var(--spacing-xl);
    margin-top: var(--spacing-xs);
    border-top: 1px solid var(--border-default);
}

.password-rules p {
    margin: var(--spacing-none);
    color: var(--text-subtle);
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
}

.password-rules.requirements {
    list-style: none;
}

.password-rules.requirements li {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-none);
    color: var(--text-error);
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
}

.password-rules.requirements li::before {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-onColor);
    background: var(--text-error);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    content: "x";
}

.password-rules.requirements li.met {
    color: #15803d;
}

.password-rules.requirements li.met::before {
    background: #16a34a;
    content: "✓";
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        background-image: linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.92)), url("/assets/auth/gasco-plant.png?v=20260708-1015");
        background-position: center;
        background-size: cover;
    }

    .auth-panel {
        width: min(100%, 540px);
        min-height: 100vh;
        margin: var(--spacing-none) auto;
        border-radius: var(--radius-none);
    }

    .auth-visual {
        display: none;
    }
}

@media (max-width: 560px) {
    .auth-panel {
        align-items: flex-start;
        padding: var(--spacing-3xl) var(--spacing-xl);
    }

    .auth-card {
        width: 100%;
    }

    .auth-logo {
        width: 220px;
        margin-top: var(--spacing-4xl);
    }

    .auth-header h1 {
        font-size: 24px;
        line-height: 28px;
    }
}
