/* =========================================================
 * Página pública de registro de tablas
 * ========================================================= */
body { background: #f4f6f9; }

.rg-page { min-height: 100vh; display: flex; flex-direction: column; }
.rg-content { width: 100%; }
.rg-content img { max-width: 100%; height: auto; }

.rg-hero { text-align: center; padding: 2rem 1rem .5rem; }
.rg-hero h1 { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; margin: .75rem 0 .25rem; }
.rg-hero p { color: #6c757d; margin: 0; }

.rg-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 1rem; }
.rg-wrap-center { flex: 1; display: flex; align-items: center; }
.rg-wrap-center .rg-card { width: 100%; }

.rg-card {
    background: #fff;
    border: 1px solid var(--app-border, #e3e7ee);
    border-radius: 1rem;
    box-shadow: 0 6px 24px rgba(31, 38, 51, .08);
    padding: 1.5rem;
}
@media (min-width: 576px) { .rg-card { padding: 2rem; } }

.rg-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 .25rem; }
.rg-lead { color: #6c757d; margin-bottom: 1.25rem; }
.rg-subtitle {
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: #6c757d; margin: 1.75rem 0 .75rem;
}

/* Pasos */
.rg-steps {
    list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.5rem;
    font-size: .8rem; color: #8a93a3;
}
.rg-steps li { flex: 1; display: flex; align-items: center; gap: .4rem; padding-bottom: .6rem; border-bottom: 3px solid #e3e7ee; }
.rg-steps li span {
    width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e3e7ee; color: #5c6577; font-weight: 700;
}
.rg-steps li.is-active, .rg-steps li.is-done { color: var(--bs-body-color); border-color: var(--app-brand, #F58426); }
.rg-steps li.is-active span, .rg-steps li.is-done span { background: var(--app-brand, #F58426); color: #fff; }
@media (max-width: 420px) { .rg-steps li { flex-direction: column; align-items: flex-start; } }

/* Tipo de identificación */
.rg-segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.rg-segment .btn { border: 1px solid #ced4da; background: #fff; padding: .6rem .25rem; font-weight: 500; }
.rg-segment .btn-check:checked + .btn { border-color: var(--app-brand, #F58426); background: #fff4ea; color: #b85a0c; box-shadow: inset 0 0 0 1px var(--app-brand, #F58426); }
.rg-segment .btn-check:focus-visible + .btn { outline: 2px solid var(--app-accent, #009FC2); outline-offset: 2px; }

.rg-identity {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: #f4f6f9; border-radius: .75rem; padding: .75rem 1rem; margin-bottom: 1rem;
}
.rg-identity small { display: block; color: #6c757d; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
.rg-identity strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* Tablas del cliente */
.rg-tables { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.rg-tables li {
    display: inline-flex; align-items: center; gap: .5rem;
    border: 1px solid #e3e7ee; border-radius: 999px; padding: .3rem .4rem .3rem .8rem; background: #fff;
}
.rg-code { font-family: var(--bs-font-monospace); font-weight: 600; letter-spacing: .02em; }
.rg-pending {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    margin-top: .75rem; padding: .75rem 1rem; border-radius: .75rem;
    background: #fff8e6; border: 1px solid #ffe2a8; font-size: .9rem;
}

/* Códigos de tabla */
.rg-code-row { display: flex; gap: .5rem; margin-bottom: .5rem; align-items: flex-start; }
.rg-code-row > div { flex: 1; }
.rg-code-row input { font-family: var(--bs-font-monospace); text-transform: uppercase; letter-spacing: .04em; }
.rg-code-row input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--bs-body-font-family); }

/* Autocompletado de ciudad */
.rg-autocomplete { position: relative; }
.rg-autocomplete-list {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
    list-style: none; margin: 0; padding: .25rem; max-height: 260px; overflow-y: auto;
    background: #fff; border: 1px solid #ced4da; border-radius: .5rem; box-shadow: 0 8px 24px rgba(31, 38, 51, .14);
}
.rg-autocomplete-list li { padding: .55rem .75rem; border-radius: .35rem; cursor: pointer; }
.rg-autocomplete-list li small { color: #6c757d; margin-left: .35rem; }
.rg-autocomplete-list li:hover, .rg-autocomplete-list li.is-active { background: #fff4ea; }
.rg-autocomplete-list li.rg-empty { cursor: default; color: #6c757d; background: none; }

.invalid-feedback.d-block { display: block; }

/* Confirmación y cierre */
.rg-success-icon {
    width: 4.5rem; height: 4.5rem; margin: 0 auto 1rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #e7f6ec; color: #198754; font-size: 2.2rem;
}
.rg-warning-icon { background: #fff4e0; color: #c77700; }
.rg-closed { text-align: center; color: #6c757d; }
.rg-closed i { font-size: 2.5rem; }
.rg-closed h2 { font-size: 1.25rem; font-weight: 700; color: var(--bs-body-color); margin: .5rem 0; }

/* Campos obligatorios */
.rg-req {
    color: var(--bs-danger, #dc3545);
    font-weight: 700;
}

.rg-required-note {
    margin: -.25rem 0 1rem;
    font-size: .8125rem;
    color: var(--bs-secondary-color, #6c757d);
}
