/* ============================================================
   CssSetup.css - Setup Wizard Multi-Empresas
   Diseno Glass Teal, profesional, empresarial
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    font-family: 'Calibri', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.setup-body {
    background: linear-gradient(135deg, #0F766E 0%, #0E7490 50%, #1E40AF 100%);
    min-height: 100vh;
    padding: 20px 20px 80px 20px;                    /* Espacio inferior para footer */
    position: relative;
    overflow-x: hidden;
}

/* ============================================================
   BLOBS DECORATIVOS
   ============================================================ */
.setup-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.setup-blob-1 {
    top: -100px;
    left: -100px;
    width: 350px;
    height: 350px;
    background: rgba(255, 255, 255, 0.12);
}
.setup-blob-2 {
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(45, 212, 191, 0.18);
}

/* ============================================================
   MASTER PASSWORD CARD (PASO 0)
   ============================================================ */
.master-wrap {
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 20px;
}

.master-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 40px 36px;
    max-width: 440px;
    width: 100%;
}

.master-icon {
    width: 90px !important;
    height: 90px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    background: none !important;
    box-shadow: none !important;
    overflow: hidden;
}

.master-icon-img {
    width: 90px !important;
    height: 90px !important;
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
    display: block;
}

.master-title {
    text-align: center;
    color: #0F172A;
    font-size: 23px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.master-sub {
    text-align: center;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.master-label {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 6px;
    display: block;
    letter-spacing: 0.5px;
}

.master-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #0F172A;
    border-radius: 8px;
    font-size: 15px;
    color: #000000;
    font-weight: 600;
    font-family: 'Calibri', sans-serif;
    background: white;
    transition: all 0.2s ease;
}

.master-input:focus {
    outline: none;
    border-color: #1E40AF;
    background: #F0F9FF;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.master-btn {
    width: 100%;
    margin-top: 18px;
    background: #1E40AF;
    color: white;
    padding: 13px;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Calibri', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.master-btn:hover {
    background: #1E3A8A;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

.master-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.master-hint {
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
    margin-top: 14px;
    font-weight: 600;
}

/* Divisor OR */
.master-divider {
    display: flex;
    align-items: center;
    margin: 22px 0 16px;
    color: #94A3B8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}
.master-divider::before,
.master-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}
.master-divider span {
    padding: 0 12px;
}

/* Boton secundario - ir a Multi-Empresas */
.master-secondary-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #16A34A;
    color: white;
    padding: 13px;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Calibri', sans-serif;
    text-decoration: none;
}
.master-secondary-btn:hover {
    background: #15803D;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

/* ============================================================
   WIZARD PRINCIPAL
   ============================================================ */
.swz-wrap {
    max-width: 920px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.swz-header {
    text-align: center;
    color: white;
    margin-bottom: 24px;
    padding: 20px 0;
}

.swz-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 18px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.swz-title {
    font-size: 33px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.swz-subtitle {
    color: #FEF3C7;
    font-weight: 600;
    font-size: 16px;
}

.swz-sale-tag {
    display: inline-block;
    margin-top: 12px;
    background: linear-gradient(90deg, #F59E0B, #FBBF24);
    color: #000000;
    padding: 8px 24px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1.5px;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Card del formulario */
.swz-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 32px;
}

.swz-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E2E8F0;
}

.swz-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.swz-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #1E40AF;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.swz-section-title i {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #14B8A6, #06B6D4);
    color: white;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 800;
}

.swz-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

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

.swz-field {
    display: flex;
    flex-direction: column;
}

.swz-label {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.swz-required::after {
    content: ' *';
    color: #DC2626;
}

.swz-input {
    padding: 10px 12px;
    border: 1px solid #0F172A;
    border-radius: 7px;
    font-family: 'Calibri', sans-serif;
    font-size: 15px;
    color: #000000;
    font-weight: 600;
    transition: all 0.2s ease;
    background: white;
}

.swz-input::placeholder {
    color: #000000;
    opacity: 0.45;
    font-weight: 600;
}

.swz-input:focus {
    outline: none;
    border-color: #1E40AF;
    background: #FFFBEB;
    box-shadow: 0 0 0 3px rgba(30, 64, 200, 0.12);
}

.swz-input:disabled,
.swz-input-disabled {
    background: #F1F5F9;                              /* Gris claro */
    color: #94A3B8;                                   /* Texto grisaceo */
    border-color: #CBD5E1;                            /* Borde gris */
    cursor: not-allowed;                              /* Cursor no permitido */
    opacity: 0.7;                                     /* Atenuado */
}

.swz-hint {
    font-size: 12px;
    color: #000000;
    font-weight: 600;
    margin-top: 4px;
}

.swz-hint b {
    font-weight: 800;
    color: #1E40AF;
    font-family: 'Consolas', monospace;
}

.swz-suggested {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #0F766E;
    font-weight: 800;
    margin-top: 4px;
}

/* Money wrap (input con $) */
.swz-money-wrap {
    position: relative;
}
.swz-money-wrap::before {
    content: '$';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #0F766E;
    font-weight: 800;
    font-size: 15px;
    z-index: 1;
}
.swz-money-wrap .swz-input {
    padding-left: 26px;
}

/* BOTONES DE ACCION */
.swz-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
}

.swz-btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-family: 'Calibri', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.swz-btn-cancel {
    background: #E5E7EB;
    color: #1F2937;
}

.swz-btn-cancel:hover {
    background: #9CA3AF;
    color: #FFFFFF;
}

.swz-btn-save {
    background: #16A34A;
    color: white;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

.swz-btn-save:hover {
    background: #15803D;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.55);
    transform: translateY(-1px);
}

.swz-btn-save:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.setup-flash {
    display: none;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
    align-items: center;
    gap: 10px;
}
.setup-flash-show {
    display: flex;
}
.setup-flash-error {
    background: rgba(220, 38, 38, 0.95);
    color: white;
}
.setup-flash-success {
    background: rgba(22, 163, 74, 0.95);
    color: white;
}
.setup-flash i {
    font-size: 18px;
}

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.modal-show {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease-out;
}

.modal-card-small {
    max-width: 420px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    color: white;
    padding: 26px;
    text-align: center;
}

.modal-header-success {
    background: linear-gradient(135deg, #16A34A, #22C55E);
}

.modal-header-error {
    background: linear-gradient(135deg, #DC2626, #EF4444);
}

.modal-header-warning {
    background: linear-gradient(135deg, #D97706, #F59E0B);
}

.modal-icon-circle {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 12px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.modal-sub {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 600;
}

.modal-body {
    padding: 26px;
}

.modal-msg {
    color: #0F172A;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Detalles de error */
.modal-details {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 8px;
}

.modal-detail-row {
    display: flex;
    padding: 5px 0;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-detail-label {
    font-weight: 700;
    color: #991B1B;
    min-width: 130px;
}

.modal-detail-value {
    color: #0F172A;
    font-weight: 600;
    font-family: 'Consolas', monospace;
    flex: 1;
    word-break: break-all;
}

/* Detalles de exito */
.success-details {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 8px;
}

.success-detail-label {
    font-weight: 700;
    color: #166534;
    min-width: 140px;
}

.success-section {
    margin-bottom: 14px;
}

.success-section:last-child {
    margin-bottom: 0;
}

.success-section-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #166534;
    margin-bottom: 8px;
    text-transform: uppercase;
    padding-bottom: 4px;
    border-bottom: 1px solid #86EFAC;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Caja de credenciales */
.creds-box {
    background: #FFFBEB;
    border: 2px dashed #F59E0B;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
}

.creds-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #92400E;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.creds-row {
    display: flex;
    padding: 4px 0;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.creds-label {
    font-weight: 700;
    color: #92400E;
    min-width: 100px;
}

.creds-value {
    color: #0F172A;
    font-weight: 700;
    font-family: 'Consolas', monospace;
    flex: 1;
    word-break: break-all;
}

/* Botones del modal */
.modal-actions {
    padding: 0 26px 26px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.8px;
    cursor: pointer;
    border: none;
    font-family: 'Calibri', sans-serif;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-btn-secondary {
    background: #E5E7EB;
    color: #1F2937;
}
.modal-btn-secondary:hover {
    background: #9CA3AF;
    color: white;
}

.modal-btn-primary {
    background: #1E40AF;
    color: white;
}
.modal-btn-primary:hover {
    background: #1E3A8A;
}

.modal-btn-success {
    background: #16A34A;
    color: white;
}
.modal-btn-success:hover {
    background: #15803D;
}

.modal-btn-danger {
    background: #DC2626;
    color: white;
}
.modal-btn-danger:hover {
    background: #B91C1C;
}

/* ============================================================
   FOOTER
   ============================================================ */
.setup-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .swz-grid {
        grid-template-columns: 1fr;
    }
    .swz-title {
        font-size: 24px;
    }
    .swz-card {
        padding: 22px;
    }
    .master-card {
        padding: 30px 24px;
    }
    .swz-actions {
        flex-direction: column-reverse;
    }
    .swz-btn {
        width: 100%;
        justify-content: center;
    }
    .modal-actions {
        flex-direction: column-reverse;
    }
    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   LABEL DE VENCIMIENTO DE TRIAL
   Solo visible cuando System Type = "Trial 15 days".
   Aparece debajo del campo Acquisition Date e indica la fecha
   en que termina el periodo de prueba (Acquisition Date + 15).
   ============================================================ */
.swz-trial-expiry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #B45309;                                   /* Ambar oscuro - atencion */
    font-weight: 800;
    margin-top: 6px;
    padding: 4px 10px;
    background: #FEF3C7;                              /* Fondo ambar claro */
    border-left: 3px solid #F59E0B;                   /* Acento ambar */
    border-radius: 4px;
}
.swz-trial-expiry b {
    font-weight: 900;
    color: #92400E;
    font-family: 'Consolas', monospace;
}
