:root {
    --bg: #0f172a;
    --card-bg: #020617;
    --accent: #38bdf8;
    --accent-soft: #0f766e;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #1f2933;
    --danger: #f97373;
    --warning: #facc15;
    --success: #22c55e;
    --radius: 12px;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    background: radial-gradient(circle at top, #1e293b 0, #020617 50%);
    color: var(--text);
    font-family: var(--font-main);
}

.container {
    max-width: 960px;
    margin: 0 auto;
}

.card {
    background: linear-gradient(145deg, #020617, #020617);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

h1, h2, h3 {
    margin-top: 0;
    color: #f9fafb;
}

h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 118, 110, 0.25);
    font-size: 0.8rem;
    color: #a5f3fc;
}

.section {
    margin-bottom: 24px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.09), transparent 60%);
}

.section-title {
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 0.9rem;
    color: #e5e7eb;
}

input[type="text"],
input[type="email"],
select,
textarea {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background-color: rgba(15, 23, 42, 0.85);
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 6px 18px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.checkbox-item input {
    margin-top: 2px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
    font-size: 0.9rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.semaphore-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
}

.semaphore {
    width: 56px;
    height: 140px;
    border-radius: 18px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.semaphore-light {
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border-radius: 999px;
    background: #111827;
    opacity: 0.25;
    box-shadow: none;
}

.semaphore-light.active {
    opacity: 1;
    box-shadow: 0 0 14px currentColor;
}

.semaphore-light.green { color: var(--success); background: #16a34a; }
.semaphore-light.yellow { color: var(--warning); background: #eab308; }
.semaphore-light.red { color: var(--danger); background: #ef4444; }

.status-label {
    font-weight: 600;
    font-size: 1rem;
}

.status-label.green { color: var(--success); }
.status-label.yellow { color: var(--warning); }
.status-label.red { color: var(--danger); }

.status-description {
    font-size: 0.9rem;
    color: var(--muted);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    border-radius: 999px;
    padding: 8px 16px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #f9fafb;
    border-color: transparent;
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.6);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.small-text {
    font-size: 0.8rem;
    color: var(--muted);
}

.json-block {
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    max-height: 260px;
    overflow: auto;
}

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-top: 10px;
}

.alert-info {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #bfdbfe;
}

.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.8);
    color: #bbf7d0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.8);
    color: #fecaca;
}

footer {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--muted);
}
/* Floating semaphore panel */
#floating-semaphore {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 200px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    z-index: 9999;
    border: 1px solid rgba(148,163,184,0.25);
}

/* Mobile reposition */
@media (max-width: 768px) {
    #floating-semaphore {
        top: auto;
        bottom: 16px;
        right: 12px;
        width: 170px;
    }
}

.fs-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #cbd5e1;
    text-align: center;
}

.fs-lights {
    display: flex;
    justify-content: space-around;
    margin-bottom: 8px;
}

.fs-light {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    opacity: 0.25;
    transition: 0.2s ease;
}

.fs-light.red { background: #ef4444; }
.fs-light.yellow { background: #eab308; }
.fs-light.green { background: #22c55e; }

.fs-light.active {
    opacity: 1;
    box-shadow: 0 0 10px currentColor;
}

.fs-text {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

