:root {
    --ic-blue-dark: #005775;
    --ic-blue-primary: #00508d;
    --ic-blue-medium: #044572;
    --ic-blue-bright: #0a6fb8;
    --ic-blue-50: #f2f8fc;
    --ic-blue-100: #e6f2f8;
    --ic-blue-200: #b3d9ed;
    --ic-gray-50: #f8fafb;
    --ic-gray-100: #f0f4f8;
    --ic-gray-200: #d9e2ec;
    --ic-gray-600: #627d98;
    --ic-gray-700: #486581;
    --ic-gray-800: #334e68;
    --ic-gray-900: #243b53;
    --ic-gradient-primary: linear-gradient(135deg, #0a6fb8 0%, #005775 100%);
    --ic-gradient-button: linear-gradient(135deg, #0a6fb8 0%, #00508d 100%);
    --ok: #1a8f5e;
    --error: #d1453b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, Arial, sans-serif;
    background: var(--ic-gray-50);
    color: var(--ic-gray-900);
}

.setup-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.setup-card {
    width: 100%;
    max-width: 980px;
    min-height: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 87, 117, 0.15);
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
}

.setup-rail {
    background: var(--ic-gradient-primary);
    color: #fff;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.setup-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setup-brand__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px;
}

.setup-brand strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
}

.setup-brand span {
    display: block;
    font-size: 12px;
    opacity: 0.75;
}

.rail-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rail-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    opacity: 0.55;
    font-size: 13px;
}

.rail-step.is-active,
.rail-step.is-done {
    opacity: 1;
}

.rail-step.is-active {
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

.rail-step__dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.rail-step.is-done .rail-step__dot {
    background: #fff;
    color: var(--ic-blue-primary);
    border-color: #fff;
}

.setup-content {
    padding: 40px 48px;
    overflow-y: auto;
}

.setup-content h1 {
    font-size: 22px;
    margin: 0 0 6px;
    color: var(--ic-blue-medium);
}

.setup-content p.setup-lead {
    color: var(--ic-gray-600);
    margin: 0 0 28px;
    font-size: 14px;
}

.check-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ic-gray-50);
    border: 1px solid var(--ic-gray-200);
    font-size: 13px;
}

.check-item__label {
    font-weight: 500;
    color: var(--ic-gray-800);
}

.check-item__detalle {
    color: var(--ic-gray-600);
    font-size: 12px;
}

.check-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.check-badge.ok {
    background: #e3f6ee;
    color: var(--ok);
}

.check-badge.fail {
    background: #fbe9e8;
    color: var(--error);
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 520px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row--inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ic-gray-800);
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="url"],
.form-row select {
    border: 1px solid var(--ic-gray-200);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ic-gray-900);
    background: #fff;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--ic-blue-bright);
    box-shadow: 0 0 0 3px var(--ic-blue-100);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--ic-gray-600);
}

.field-error {
    font-size: 12px;
    color: var(--error);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--ic-gradient-button);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--ic-gray-100);
    color: var(--ic-gray-800);
}

.btn.is-hidden {
    display: none;
}

.alert {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fbe9e8;
    color: #9a2e28;
    border: 1px solid #f3c6c3;
}

.alert-success {
    background: #e3f6ee;
    color: #146c48;
    border: 1px solid #b9e6d1;
}

.test-result {
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
}

.test-result.ok { color: var(--ok); }
.test-result.fail { color: var(--error); }

.summary-block {
    background: var(--ic-gray-50);
    border: 1px solid var(--ic-gray-200);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.summary-block h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--ic-blue-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: var(--ic-gray-800);
}

.summary-row span:first-child {
    color: var(--ic-gray-600);
}

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.finish-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e3f6ee;
    color: var(--ok);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
}

@media (max-width: 720px) {
    .setup-card { grid-template-columns: 1fr; }
    .setup-rail { flex-direction: row; align-items: center; padding: 20px; }
    .rail-steps { display: none; }
    .setup-content { padding: 28px 24px; }
    .form-grid { grid-template-columns: 1fr; }
}
