:root {
    --brand-blue: #0061e0;
    --brand-dark: #07162d;
    --bg-gray: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}
.mandatory-uppercase {
    text-transform: uppercase;
}
.mandatory-uppercase::placeholder {
    text-transform: none;
}
body {
    margin: 0;
    background: url('/modules/siegixconnect/assets/img/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px);
    z-index: -1;
}
.sgx-top-nav {
    background: var(--brand-dark);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.sgx-top-nav img {
    height: 45px;
}
.sgx-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 20px;
}
.sgx-stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    /* margin-bottom: 40px; */
    gap: 20px;
    background-color: white;
    padding: 30px;
}
.sgx-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 500;
}
.sgx-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.sgx-step-item.active { color: var(--brand-blue); }
.sgx-step-item.active .sgx-step-circle { background: var(--brand-blue); }
.sgx-step-line {
    width: 60px;
    height: 2px;
    background: #cbd5e1;
}
.sgx-main-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    position: relative;
}
.sgx-card-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 30px;
}
.sgx-icon-box {
    width: 80px;
    height: 80px;
    background: #e0f2fe;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-blue);
    font-size: 40px;
    flex-shrink: 0;
}
.sgx-title { font-size: 28px; font-weight: 700; margin: 0 0 8px; color: #0f172a; }
.sgx-sub { color: var(--text-muted); font-size: 15px; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}
.form-label { font-weight: 600; font-size: 13px; color: #334155; margin-bottom: 8px; display: block; }
.form-label .required { color: #ef4444; margin-left: 2px; }
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    height: 44px;
    background: #f8fafc;
    box-shadow: none !important;
    color: #1e293b;
}
.form-control:focus { border-color: var(--brand-blue); background: #fff; color: #1e293b; }

select.form-control {
    color: #1e293b !important;
}
select.form-control option {
    color: #1e293b !important;
    background-color: #fff !important;
    padding: 10px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: #fdfdfd;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-area:hover { border-color: var(--brand-blue); background: #f0f7ff; }
.upload-area i { font-size: 24px; color: var(--brand-blue); margin-bottom: 8px; }
.upload-area div { font-weight: 600; font-size: 13px; }
.upload-area span { font-size: 11px; color: var(--text-muted); }

.phone-group { display: flex; gap: 0px; position: relative; }
.country-select-wrapper { position: relative; width: 100px; flex-shrink: 0; }
.country-select-wrapper img { position: absolute; left: 8px; top: 12px; width: 20px; height: 15px; pointer-events: none; border-radius: 2px; }
.country-select { padding-left: 35px !important; width: 100% !important; }
.flag-icon { width: 20px; height: 15px; vertical-align: middle; margin-right: 8px; border-radius: 2px; box-shadow: 0 0 2px rgba(0,0,0,0.1); }

.sgx-footer-actions, .sgx-step-actions {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

#global-footer.step-1-layout {
    justify-content: flex-end !important;
}
#global-footer.step-1-layout #prev-btn {
    display: none !important;
}
#global-footer.step-1-layout #autosave-status {
    order: 1;
    margin-right: 12px;
}
#global-footer.step-1-layout #next-btn {
    order: 2;
}
.btn-default {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
}
.btn-continue, #next-btn, button[type="submit"] {
    background: #28a745 !important;
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-continue:hover, #next-btn:hover { background: #218838 !important; opacity: 1; transform: translateY(-1px); }
.btn-default, #prev-btn {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.btn-link-button {
    border: 2px solid #22c55e;
    background: #fff;
    color: #334155;
    padding: 11px 18px;
    border-radius: 12px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.btn-link-button:hover {
    background: #f0fdf4;
    color: #15803d;
    border-color: #22c55e;
}
.rnc-lookup-wrap {
    border: 2px solid #0ea5e9;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    position: relative;
}
.rnc-lookup-wrap .form-control {
    border: none !important;
    border-radius: 0 !important;
    height: 44px;
    font-size: 15px;
    padding-left: 14px;
    padding-right: 12px;
    background: #fff;
}
.rnc-lookup-wrap .form-control:focus {
    box-shadow: none !important;
}
.rnc-inline-alert {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    font-weight: 700;
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
    display: none;
}
.description-banner {
    background: #e0f2fe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 13px;
    color: #0c4a6e;
}
.rnc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f8fafc;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
}
.rnc-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.rnc-status-dot.rnc-dot-active { background: #22c55e; }
.rnc-status-dot.rnc-dot-suspended { background: #eab308; }
.rnc-status-dot.rnc-dot-inactive { background: #ef4444; }
.rnc-status-dot.rnc-dot-unknown { background: #94a3b8; }
.btn-buscar-rnc {
    background: #0ea5e9;
    color: #fff;
    border: none;
    font-weight: 700;
    border-radius: 0 !important;
    padding: 0 24px;
    min-width: 130px;
    height: 44px;
    font-size: 14px;
    letter-spacing: 0.4px;
    border-left: 2px solid #0284c7;
}
.btn-buscar-rnc:hover,
.btn-buscar-rnc:focus {
    color: #fff;
    background: #0284c7;
}
.sgx-step2-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
}
.sgx-step2-add-row .btn-add-contact-row {
    /* width: 100%; */
    background: var(--brand-blue) !important;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.sgx-step2-add-row .btn-add-contact-row:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}
.sgx-step2-nav-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    width: 100%;
}
.sgx-step2-nav-row .btn-continue {
    flex: 0 0 auto;
}
.sgx-step3-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.sgx-step3-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.sgx-step3-nav .btn-submit-reg {
    flex: 1;
    min-width: 0;
}
.autosave-status { font-size: 13px; color: #10b981; display: flex; align-items: center; gap: 5px; opacity: 0; transition: opacity 0.5s; }

.footer-copyright {
    text-align: center;
    padding: 30px;
    color: #fff;
    background: var(--brand-dark);
    /* margin-top: 40px; */
    font-size: 14px;
}

.hidden-step { display: none; }
.has-icon { position: relative; }
.has-icon i { position: absolute; left: 14px; top: 14px; color: var(--text-muted); font-size: 16px; }
.has-icon .form-control { padding-left: 40px; }

.sgx-contact-card {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    background: #fcfcfc;
    margin-bottom: 20px;
}

/* Success Offcanvas */
.sgx-offcanvas-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    display: none;
    pointer-events: none;
    transition: all 0.3s ease;
}
.sgx-offcanvas-overlay.active {
    opacity: 1;
    visibility: visible;
    display: block;
    pointer-events: auto;
}
.sgx-offcanvas {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    display: none;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.sgx-offcanvas.active {
    opacity: 1;
    visibility: visible;
    display: block;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.offcanvas-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
}
.success-circle {
    width: 70px;
    height: 70px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    margin: 0 auto 20px;
}
.offcanvas-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
}
.offcanvas-subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 30px;
}
.info-box {
    background: #f0f7ff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    color: #1e293b;
    font-size: 14px;
}
.info-box i {
    color: #0061e0;
    font-size: 20px;
    margin-top: 2px;
}
.benefit-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}
.benefit-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.benefit-icon {
    width: 32px;
    height: 32px;
    background: #e0f2fe;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0061e0;
    font-size: 16px;
    flex-shrink: 0;
}
.benefit-text {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}
.offcanvas-footer {
    font-size: 13px;
    color: #64748b;
    text-align: left;
    line-height: 1.6;
    margin-bottom: 30px;
}
.btn-entendido {
    width: 100%;
    background: #0061e0;
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    border: none;
    transition: transform 0.2s;
}
.btn-entendido:hover { transform: scale(0.98); }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 600px) {
    .summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sgx-stepper { padding: 20px 10px; gap: 10px; }
    .sgx-step-line { width: 30px; }
    .sgx-step-item span { font-size: 11px; }
    .sgx-main-card { padding: 25px 20px; border-radius: 15px; }
    .sgx-card-header { flex-direction: column; align-items: center; text-align: center; gap: 15px; }
    .sgx-icon-box { width: 60px; height: 60px; font-size: 30px; }
    .sgx-title { font-size: 22px; }
    .sgx-sub { font-size: 14px; }
    .sgx-footer-actions, .sgx-step-actions { flex-direction: column; gap: 15px; align-items: stretch; }
    .sgx-nav-btns { flex-direction: row; width: 100%; gap: 10px; }
    .sgx-nav-btns button { flex: 1; min-width: 0; }
    .btn-continue { justify-content: center; }
    .sgx-shell { padding: 10px; }
}

@media (max-width: 480px) {
    .sgx-step2-add-row .btn-add-contact-row { width: 100%; }
    .sgx-step2-nav-row { justify-content: space-between; }
    #header-reset-btn { margin-left: auto !important; }
    .sgx-stepper { padding: 20px; gap: 5px; justify-content: space-between; }
    .sgx-step-line { display: block; flex: 1; min-width: 10px; height: 1px; background: #cbd5e1; }
    .sgx-step-item span { display: none; }
    .sgx-step-item.active span { display: block; position: absolute; top: 62px; width: 100px; text-align: center; left: 50%; transform: translateX(-50%); white-space: nowrap; }
    .sgx-stepper { position: relative; padding-bottom: 40px; margin-bottom: 20px; }
}

/* 16-inch or large screen optimization */
@media (min-width: 1400px) {
    .sgx-shell { max-width: 1100px; }
    .sgx-main-card { padding: 50px; }
}