/* ===================================================================
   GESTIA ERP — INSTALLATION WIZARD STYLESHEET
   Premium Stepper Design — Coherente con Login
   =================================================================== */

:root {
    --primary-teal: #0d9488;
    --teal-deep: #0f766e;
    --teal-accent: #14b8a6;
    --teal-light: #ccfbf1;
    --teal-50: #f0fdfa;
    --bg-page: #f1f5f9;
    --bg-brand: linear-gradient(160deg, #0d9488 0%, #0f766e 40%, #115e59 100%);
    --bg-form: #ffffff;
    --text-main: #1e293b;
    --text-muted: #94a3b8;
    --text-secondary: #64748b;
    --white: #ffffff;
    --radius-xl: 1.75rem;
    --radius-lg: 1.25rem;
    --radius-md: 0.875rem;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }

body.install-body {
    margin: 0; padding: 0;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--bg-page);
    background-image:
        radial-gradient(at 20% 20%, rgba(20,184,166,0.06) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(99,102,241,0.04) 0px, transparent 50%);
}

/* ===== WIZARD CONTAINER ===== */
.wizard-container {
    width: 100%; max-width: 780px;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin: 20px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 10px 30px -5px rgba(0,0,0,0.08),
        0 0 0 1px rgba(0,0,0,0.03);
    animation: containerIn 0.8s cubic-bezier(0.16,1,0.3,1);
}
@keyframes containerIn {
    from { opacity: 0; transform: translateY(24px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== WIZARD HEADER ===== */
.wizard-header {
    background: var(--bg-brand);
    padding: 2rem 2.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}
.wizard-header::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}
.wizard-header .deco-circle {
    position: absolute; top: -80px; right: -80px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 65%);
    border-radius: 50%;
}
.wizard-header h1 {
    font-size: 1.6rem; font-weight: 700;
    color: #fff; position: relative; z-index: 2;
    letter-spacing: -0.3px;
}
.wizard-header h1 span { color: var(--teal-light); }
.wizard-header p {
    font-size: 0.9rem; color: rgba(255,255,255,0.6);
    margin-top: 0.35rem; position: relative; z-index: 2;
}

/* ===== STEPPER ===== */
.stepper {
    display: flex; justify-content: center;
    padding: 0 2.5rem;
    margin-top: -1.25rem;
    position: relative; z-index: 10;
}
.stepper-item {
    display: flex; flex-direction: column; align-items: center;
    flex: 1; position: relative;
}
.stepper-item:not(:last-child)::after {
    content: '';
    position: absolute; top: 20px; left: calc(50% + 22px);
    width: calc(100% - 44px); height: 3px;
    background: #e2e8f0;
    transition: background 0.4s ease;
}

.stepper-item.completed:not(:last-child)::after {
    background: var(--primary-teal);
}
.step-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid #e2e8f0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
    position: relative; z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stepper-item.active .step-circle {
    border-color: var(--primary-teal);
    color: var(--primary-teal);
    background: var(--teal-50);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.12), 0 2px 8px rgba(0,0,0,0.06);
}
.stepper-item.completed .step-circle {
    border-color: var(--primary-teal);
    background: var(--primary-teal);
    color: #fff;
}
.step-label {
    margin-top: 0.55rem;
    font-size: 0.72rem; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}
.stepper-item.active .step-label { color: var(--primary-teal); }
.stepper-item.completed .step-label { color: var(--teal-deep); }

/* ===== PANELS ===== */
.wizard-body {
    padding: 2rem 2.5rem 2.5rem;
}
.wizard-panel {
    display: none;
    animation: panelIn 0.45s ease;
}
.wizard-panel.active { display: block; }
@keyframes panelIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.panel-title {
    font-size: 1.2rem; font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}
.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ===== FORM STYLES ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group.full-width {
    grid-column: 1 / -1;
}
.form-group label {
    display: block;
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}
.form-group input::placeholder {
    color: #c4cbda; font-weight: 400;
}
.form-group input:focus, .form-group select:focus {
    background-color: #fff;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.08);
}
.form-group .input-icon {
    position: relative;
}
.form-group .input-icon i {
    position: absolute; left: 0.9rem; top: 50%;
    transform: translateY(-50%);
    color: #b0bec5; font-size: 0.95rem;
    transition: color 0.3s ease;
    z-index: 2;
}
.form-group .input-icon input {
    padding-left: 2.6rem;
}
.form-group .input-icon:focus-within i {
    color: var(--primary-teal);
}

/* ===== BUTTONS ===== */
.wizard-actions {
    display: flex; justify-content: space-between;
    margin-top: 1.5rem;
    gap: 1rem;
}
.btn-wizard {
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-weight: 600; font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
    border: none;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-prev {
    background: #f1f5f9; color: var(--text-secondary);
}
.btn-prev:hover {
    background: #e2e8f0;
}
.btn-next, .btn-install {
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--teal-deep) 100%);
    color: #fff;
    box-shadow: 0 4px 12px -3px rgba(13,148,136,0.2);
}
.btn-next:hover, .btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(13,148,136,0.3);
}
.btn-next:active, .btn-install:active { transform: translateY(0); }

.btn-test {
    background: transparent;
    border: 1.5px solid var(--primary-teal);
    color: var(--primary-teal);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-weight: 600; font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.btn-test:hover {
    background: var(--teal-50);
}
.btn-test.testing {
    opacity: 0.7; pointer-events: none;
}

/* ===== STATUS MESSAGES ===== */
.status-msg {
    padding: 0.65rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 1rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    animation: panelIn 0.3s ease;
}
.status-msg.show { display: flex; }
.status-msg.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.status-msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.status-msg.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.status-msg i { font-size: 1rem; }

/* ===== PROGRESS / INSTALL STEP ===== */
.progress-container {
    margin: 1rem 0;
}
.progress-bar-track {
    width: 100%; height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--primary-teal), var(--teal-accent));
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
}
.progress-log {
    margin-top: 1rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    line-height: 1.65;
}
.progress-log .log-ok { color: var(--success); }
.progress-log .log-err { color: var(--danger); }
.progress-log .log-info { color: var(--primary-teal); }

/* ===== SUCCESS SCREEN ===== */
.success-screen {
    text-align: center;
    padding: 1rem 0;
}
.success-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--primary-teal), var(--teal-accent));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    animation: successPop 0.6s cubic-bezier(0.16,1,0.3,1);
}
.success-icon i { font-size: 2.2rem; color: #fff; }
@keyframes successPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.credentials-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin: 1.25rem auto;
    max-width: 320px;
    text-align: left;
}
.credentials-card .cred-row {
    display: flex; justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.88rem;
}
.credentials-card .cred-row span:first-child {
    color: var(--text-muted); font-weight: 500;
}
.credentials-card .cred-row span:last-child {
    font-weight: 700; color: var(--text-main);
    font-family: 'Courier New', monospace;
}
.security-alert {
    background: #FEF3C7;
    border: 1.5px solid #F59E0B;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    text-align: left;
    font-size: 0.82rem;
    color: #92400e;
    display: flex; align-items: flex-start; gap: 0.6rem;
}
.security-alert i {
    font-size: 1.2rem; color: #F59E0B;
    flex-shrink: 0; margin-top: 0.1rem;
}
.btn-login {
    background: linear-gradient(135deg, var(--primary-teal), var(--teal-deep));
    color: #fff; border: none;
    padding: 0.85rem 2.5rem;
    border-radius: var(--radius-md);
    font-family: 'Outfit', sans-serif;
    font-weight: 700; font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
    display: inline-flex; align-items: center; gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px -3px rgba(13,148,136,0.2);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(13,148,136,0.3);
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .wizard-container { margin: 10px; }
    .wizard-header { padding: 1.5rem 1.5rem 2rem; }
    .wizard-body { padding: 1.5rem; }
    .stepper { padding: 0 1.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .wizard-header h1 { font-size: 1.3rem; }
    .step-label { font-size: 0.65rem; }
}
