/* setup.php installation wizard. Builds on auth.css (.auth-card, labels, inputs, buttons). */

.auth-card.setup-card {
    max-width: 560px;
}

.setup-card h2 {
    font-size: 17px;
    margin: 4px 0 8px;
    color: #111827;
}

.setup-card .hint {
    margin: 0 0 16px;
}

.setup-card code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* Progress indicator */
.setup-steps {
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 0;
    margin: 0 0 24px;
}

.setup-steps li {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    position: relative;
}

.setup-steps li + li::before {
    content: "";
    position: absolute;
    top: 11px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.setup-steps li.is-done + li::before,
.setup-steps li.is-done + li.is-current::before {
    background: #2563eb;
}

.setup-step-dot {
    position: relative;
    z-index: 1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
}

.setup-steps li.is-done { color: #374151; }
.setup-steps li.is-done .setup-step-dot { background: #2563eb; border-color: #2563eb; color: #fff; }
.setup-steps li.is-current { color: #111827; font-weight: 600; }
.setup-steps li.is-current .setup-step-dot { border-color: #2563eb; color: #2563eb; }

@media (max-width: 520px) {
    .setup-step-label { display: none; }
    .setup-steps li.is-current .setup-step-label { display: block; }
}

/* Fields auth.css doesn't style */
.setup-card input[type="email"],
.setup-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 18px;
    background: #fff;
    font-family: inherit;
}

.setup-card input[type="email"]:focus,
.setup-card select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.setup-card input[type="file"] {
    font-size: 13px;
    max-width: 100%;
}

/* Password input (eye toggle inside, from auth.css) + Generate button beside it */
.setup-password {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.setup-password .password-field {
    flex: 1;
    min-width: 0;
}

.setup-card .setup-password input {
    margin-bottom: 0;
    height: 40px;
}

.setup-card button.setup-generate {
    width: auto;
    flex: none;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.setup-card button.setup-generate:hover {
    background: #eff6ff;
}

.setup-optional {
    font-weight: 400;
    color: #9ca3af;
}

.setup-field-hint {
    margin: -12px 0 18px;
    font-size: 12px;
    color: #6b7280;
}

/* Checkbox / radio rows */
.setup-card label.setup-check,
.setup-card label.setup-choice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 400;
    font-size: 14px;
    color: #111827;
    margin-bottom: 18px;
    cursor: pointer;
}

.setup-card label.setup-choice {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.setup-card label.setup-choice:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.setup-card label.setup-check input,
.setup-card label.setup-choice input {
    margin-top: 3px;
    flex: none;
}

.setup-card label.setup-check-inline {
    display: inline-flex;
    margin: 6px 0 0;
    font-size: 13px;
}

.setup-check-detail {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    font-weight: 400;
}

.setup-license-key {
    padding: 4px 12px 2px;
}

.setup-license-key[hidden] {
    display: none;
}

/* Uploads */
.setup-upload {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.setup-upload-preview {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    flex: none;
}

/* Requirements list */
.setup-checks {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: 13px;
}

.setup-checks li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.setup-check-icon {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.setup-checks .is-ok .setup-check-icon { background: #16a34a; }
.setup-checks .is-warn .setup-check-icon { background: #d97706; }
.setup-checks .is-fail .setup-check-icon { background: #dc2626; }
.setup-checks em { color: #d97706; font-style: normal; font-weight: 400; }

/* Review table */
.setup-review {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

.setup-review th,
.setup-review td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

.setup-review th {
    color: #6b7280;
    font-weight: 600;
    width: 34%;
}

.setup-review td:last-child {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

.setup-review a,
.setup-card .hint a {
    color: #2563eb;
}

/* Bottom navigation */
.setup-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.setup-card .setup-nav button {
    width: auto;
    min-width: 140px;
    padding: 10px 20px;
}

.setup-card button:disabled {
    opacity: 0.7;
    cursor: progress;
}

.setup-back {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
}

.setup-back:hover {
    color: #111827;
}

/* Link styled as the primary button (done / locked screens) */
.setup-btn {
    display: block;
    text-align: center;
    padding: 10px 12px;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 16px;
}

.setup-btn:hover {
    background: #1d4ed8;
}

.setup-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin: 12px 0;
}

.setup-config {
    width: 100%;
    font-family: Consolas, Menlo, monospace;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    resize: vertical;
}
