/* ═══════════════════════════════════════════
   TrainControl — Shared Controls
   ═══════════════════════════════════════════ */

/* ── Buttons ── */
.btn-primary {
    padding: 10px 24px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-on-accent);
    background: var(--tc-blue);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.btn-primary:hover {
    background: var(--tc-blue-dark);
    box-shadow: 0 4px 12px rgba(67,89,144,0.25);
}

.btn-secondary {
    padding: 10px 24px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}
.btn-secondary:hover {
    background: rgba(0,0,0,0.03);
}

/* ── Toggle switch ── */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.12);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--duration-fast) ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform var(--duration-fast) var(--ease-out);
}
.toggle input:checked + .toggle-slider {
    background: var(--tc-blue);
}
.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ── Field labels ── */
.field-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ── Settings row ── */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

/* ── Connect status ── */
.connect-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--gap-lg) 0;
}
.connect-status p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--tc-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
