:root {
    --primary-color: #e9571c;
    --secondary-color: #1a1c23;
    --auth-bg: #eef2f6;
}

.auth-body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    color: #444;
}

.auth-body--split {
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        radial-gradient(at 0% 0%, color-mix(in srgb, var(--primary-color) 14%, transparent) 0, transparent 52%),
        radial-gradient(at 100% 100%, rgba(30, 41, 59, 0.06) 0, transparent 48%),
        linear-gradient(180deg, #f7f9fb 0%, #eef2f6 100%);
}

.auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.auth-wrap.auth-wrap-wide {
    max-width: 640px;
}

.auth-wrap--split {
    max-width: 1040px;
    width: 100%;
    margin: auto;
    padding: 28px 20px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 0;
    align-items: stretch;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    max-height: 64px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.auth-shell-brand {
    position: relative;
    overflow: hidden;
    border-radius: 28px 0 0 28px;
    padding: 40px 36px;
    color: #fff;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--secondary-color) 92%, #000) 0%, var(--secondary-color) 48%, color-mix(in srgb, var(--primary-color) 55%, var(--secondary-color)) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 640px;
    box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.35);
}

.auth-shell-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 10% 0%, color-mix(in srgb, var(--primary-color) 45%, transparent), transparent 60%),
        repeating-linear-gradient(
            -18deg,
            transparent 0,
            transparent 11px,
            rgba(255, 255, 255, 0.03) 11px,
            rgba(255, 255, 255, 0.03) 12px
        );
    pointer-events: none;
}

.auth-shell-brand > * {
    position: relative;
    z-index: 1;
}

.auth-shell-brand__logo {
    margin-bottom: 8px;
}

.auth-shell-brand__logo img {
    max-height: 96px;
    width: auto;
    max-width: min(100%, 320px);
    filter: brightness(0) invert(1) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.auth-shell-brand__kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, #fff 78%, var(--primary-color));
}

.auth-shell-brand__lead {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    max-width: 32ch;
}

.auth-shell-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.auth-shell-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.auth-shell-benefits i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 13px;
}

.auth-shell-brand__foot {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-shell-brand__foot a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
    transition: opacity 0.2s, color 0.2s;
}

.auth-shell-brand__foot a:hover {
    opacity: 1;
    color: color-mix(in srgb, var(--primary-color) 70%, #fff);
}

.auth-shell-form {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-left: none;
    border-radius: 0 28px 28px 0;
    padding: 40px 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.12);
}

.auth-shell-form .auth-card {
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

.auth-shell-form .auth-legal-footer {
    margin-top: 28px;
    border-top: 1px solid #e8ecf1 !important;
    padding-top: 18px !important;
}

.auth-legal-footer a {
    color: var(--primary-color) !important;
    font-weight: 600;
    text-decoration: none;
}

.auth-legal-footer a:hover {
    color: color-mix(in srgb, var(--primary-color) 82%, #000) !important;
    text-decoration: underline;
}

.auth-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.auth-card .subtitle {
    color: #777;
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-context {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-color) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary-color) 22%, #fff);
    color: var(--secondary-color);
    font-size: 13px;
    line-height: 1.45;
}

.auth-context i {
    color: var(--primary-color);
    margin-top: 2px;
}

.auth-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--secondary-color);
    opacity: 0.75;
    margin-bottom: 8px;
    display: block;
}

.auth-input-group {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.auth-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.auth-input-group.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.auth-input-group .icon {
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: #adb5bd;
}

.auth-input-group input,
.auth-input-group select {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 14px 14px 0;
    font-weight: 500;
    background: transparent;
    min-width: 0;
}

.auth-input-group--password input {
    padding-right: 48px;
}

.auth-toggle-pass {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 2;
}

.auth-toggle-pass:hover,
.auth-toggle-pass:focus-visible {
    color: var(--primary-color);
    outline: none;
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.auth-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.auth-toolbar .form-check-label {
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}

.auth-toolbar .form-check-input {
    cursor: pointer;
    border-color: #cbd5e1;
}

.auth-toolbar .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.auth-help-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.auth-help-link:hover {
    color: color-mix(in srgb, var(--primary-color) 82%, #000);
    text-decoration: underline;
}

.btn-auth-primary {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 75%, #fff));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary-color) 30%, transparent);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    position: relative;
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 12px 22px color-mix(in srgb, var(--primary-color) 38%, transparent);
}

.btn-auth-primary.is-loading {
    pointer-events: none;
    opacity: 0.88;
}

.btn-auth-primary.is-loading .btn-auth-label {
    opacity: 0;
}

.btn-auth-primary .btn-auth-spinner {
    display: none !important;
    position: absolute;
    inset: 0;
    place-items: center;
    pointer-events: none;
}

.btn-auth-primary.is-loading .btn-auth-spinner {
    display: grid !important;
}

.btn-auth-outline {
    border: 2px solid #e5e9ef;
    background: #fff;
    color: var(--secondary-color);
    border-radius: 14px;
    padding: 12px 20px;
    font-weight: 700;
}

.auth-alt-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.auth-alt-actions .btn-auth-outline {
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-alert {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.auth-alert-danger {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.auth-link {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.auth-footer-links {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: #888;
}

.auth-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 20px;
}

.auth-mobile-logo img {
    max-height: 64px;
    filter: none;
}

/* Wizard steps */
.auth-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.auth-step-dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e9ecef;
    transition: background 0.3s;
}

.auth-step-dot.active,
.auth-step-dot.done {
    background: var(--primary-color);
}

.auth-step-panel {
    display: none;
}

.auth-step-panel.active {
    display: block;
}

.auth-step-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.auth-step-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-step-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.auth-step-actions .btn-auth-primary,
.auth-step-actions .btn-auth-outline {
    flex: 1;
}

/* Camera */
.camera-box {
    position: relative;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4/3;
    max-height: 320px;
}

.camera-box video,
.camera-box canvas,
.camera-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    gap: 10px;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

.camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.camera-actions button {
    flex: 1;
    min-width: 120px;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    border: none;
}

.btn-cam-start {
    background: var(--primary-color);
    color: #fff;
}

.btn-cam-capture {
    background: #16a34a;
    color: #fff;
}

.btn-cam-retake {
    background: #64748b;
    color: #fff;
}

.camera-note {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    line-height: 1.45;
}

.camera-note i {
    color: var(--primary-color);
}

/* Geolocation */
.geo-status {
    border: 2px dashed #e5e9ef;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    background: #fafbfc;
}

.geo-status.ok {
    border-color: #86efac;
    background: #f0fdf4;
}

.geo-status.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.geo-status .geo-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: #94a3b8;
}

.geo-status.ok .geo-icon {
    color: #16a34a;
}

.geo-status.error .geo-icon {
    color: #dc2626;
}

.geo-coords {
    font-family: monospace;
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

/* Signature */
.signature-wrap {
    border: 2px solid #e5e9ef;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    touch-action: none;
}

.signature-wrap canvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
}

.signature-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.signature-actions button {
    flex: 1;
    border: none;
    border-radius: 10px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    background: #e9ecef;
    color: #495057;
}

.anti-fraud-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .auth-wrap--split {
        grid-template-columns: 1fr;
        max-width: 520px;
        padding: 20px 16px 40px;
    }

    .auth-shell-brand {
        display: none;
    }

    .auth-shell-form {
        border: 1px solid rgba(255, 255, 255, 0.7);
        border-radius: 24px;
        padding: 28px 22px 22px;
        box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
    }

    .auth-mobile-logo {
        display: block;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 28px 20px;
    }

    .auth-wrap {
        max-width: 100%;
    }

    .auth-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-auth-primary,
    .auth-input-group,
    .auth-shell-brand__foot a {
        transition: none;
    }

    .btn-auth-primary:hover {
        transform: none;
    }
}
