/* AirWX Portal - shared.css */
:root {
  --bg:      #0d1117;
  --bg2:     #161b22;
  --bg3:     #21262d;
  --border:  #30363d;
  --text:    #e6edf3;
  --muted:   #8b949e;
  --green:   #3fb950;
  --yellow:  #d29922;
  --red:     #f85149;
  --blue:    #58a6ff;
  --orange:  #f0883e;
  --accent:  #1f6feb;
  --radius:  10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.page-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.logo a { color: var(--text); }

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.content {
  padding: 20px 16px;
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Cards ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  line-height: 1.4;
  text-align: center;
  transition: border-color 0.12s, background 0.12s;
  text-decoration: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.btn:hover { border-color: var(--blue); background: #21262dee; text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #388bfd; border-color: #388bfd; }
.btn-primary:disabled { background: var(--accent); border-color: var(--accent); }

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.1); }

.btn-sm {
  padding: 5px 12px;
  font-size: 14px;
}

.btn-full { width: 100%; }

/* ---- Forms ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 16px;
  padding: 8px 12px;
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
  transition: border-color 0.12s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
}

.form-input:disabled,
.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input.error,
.form-select.error {
  border-color: var(--red);
}

.field-error {
  font-size: 13px;
  color: var(--red);
  margin-top: 4px;
  display: none;
}

.field-error.visible { display: block; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b949e' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.checkbox-row .checkbox-label {
  font-size: 14px;
  color: var(--text);
}

/* ---- Banners ---- */
.banner {
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.banner-icon { flex-shrink: 0; font-size: 17px; }

.banner-success {
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--green);
}

.banner-error {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--red);
}

.banner-info {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
  color: var(--blue);
}

.banner-warn {
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--yellow);
}

/* ---- Step indicator ---- */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
}

.step {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  position: relative;
}

.step.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

.step.done {
  color: var(--green);
  border-bottom-color: var(--green);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 12px;
  margin-right: 5px;
  vertical-align: middle;
}

/* ---- Station list ---- */
.station-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.station-row:last-child { border-bottom: none; }

.station-info { flex: 1; min-width: 0; }

.station-id-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--blue);
}

.station-name-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---- Code blocks / credentials ---- */
.cred-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 8px 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.cred-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 4px;
}

.cred-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  color: var(--orange);
}

/* ---- One-time credential warning ---- */
.cred-warning {
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--yellow);
  font-weight: 500;
}

/* ---- Loading spinner ---- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* ---- Divider ---- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* ---- Nav footer ---- */
.nav-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}

.nav-footer a { color: var(--blue); }

/* ---- Review table ---- */
.review-table { width: 100%; border-collapse: collapse; }
.review-table td {
  padding: 6px 0;
  font-size: 16px;
  vertical-align: top;
}
.review-table td:first-child {
  color: var(--muted);
  width: 40%;
  padding-right: 12px;
}

/* ---- Instructions steps ---- */
.instr-step {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}

.instr-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.instr-step-body { flex: 1; }

.instr-step-body p { font-size: 16px; margin-bottom: 8px; }

/* ---- Utility ---- */
.text-muted { color: var(--muted); font-size: 14px; }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---- Mobile responsiveness ---- */
@media (max-width: 480px) {
  .content { padding: 14px 12px; }
  .card { padding: 16px; }
  .station-row { flex-direction: column; align-items: flex-start; }
  .station-actions { width: 100%; }
  .station-actions .btn { flex: 1; text-align: center; }
}
