:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --border: #d8dde3;
    --bg: #f5f7fa;
    --panel-bg: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

header h1 {
    margin: 0 0 4px;
    font-size: 26px;
}

.subtitle { color: var(--muted); margin: 0 0 4px; }
.req-link { margin: 0 0 20px; font-size: 14px; }
.req-link a { color: var(--primary); text-decoration: none; }
.req-link a:hover { text-decoration: underline; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.hidden { display: none !important; }

.servers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 720px) {
    .servers { grid-template-columns: 1fr; }
}

.server-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
}

.server-panel legend {
    font-weight: 600;
    padding: 0 6px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
}

label.inline { display: inline-block; margin-right: 20px; }

input, select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-secondary { background: #eef2f7; color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.test-result {
    display: inline-block;
    margin-left: 10px;
    font-size: 13px;
}
.test-result.ok { color: var(--success); }
.test-result.fail { color: var(--danger); }
.test-result.pending { color: var(--muted); }

.options { margin: 20px 0; }

.actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

#progress-section {
    margin-top: 32px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
}

#progress-section h2 {
    margin-top: 0;
    font-size: 18px;
}

.progress-bar {
    width: 100%;
    height: 22px;
    background: #e5e9f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
    color: #fff;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    white-space: nowrap;
    transition: width 0.3s ease;
    min-width: 28px;
}

#progress-status {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.log-panel {
    margin-top: 14px;
    background: #0f172a;
    color: #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
}

footer {
    margin-top: 30px;
    font-size: 12.5px;
    color: var(--muted);
}
