/* public/style.css */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --green: #238636;
  --green-hover: #2ea043;
  --green-muted: #1a3a21;
  --red: #da3633;
  --red-hover: #b91c1c;
  --red-muted: #3a1c1c;
  --blue: #1f6feb;
  --border-hover: #484f58;
  --yellow: #d29922;
  --green-fg: #3fb950;
  --red-fg: #f85149;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Consolas", monospace;
}

html, body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

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

button {
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 16px;
  background: transparent;
  color: var(--text-primary);
  transition: background 0.1s, border-color 0.1s;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

input {
  font-family: var(--font);
  font-size: 14px;
}

/* === LAYOUT === */
.page-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}

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

/* === FORM === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 12px;
  width: 100%;
  height: 32px;
}

.form-input::placeholder {
  color: var(--text-secondary);
}

.form-input:focus-visible {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.form-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}

/* === BUTTONS === */
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
  width: 100%;
  height: 32px;
}

.btn-primary:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: transparent;
  border-color: var(--border);
  color: var(--red);
  font-size: 12px;
  padding: 3px 10px;
  height: 26px;
}

.btn-danger:hover {
  background: var(--red-muted);
  border-color: var(--red);
}

.btn-danger.confirming {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
  padding: 4px 8px;
}

.btn-ghost:hover {
  color: var(--red);
  border-color: transparent;
}

/* === HEADER === */
.app-header {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.app-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* === IP CARD === */
.ip-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.ip-address {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.badge-success {
  color: var(--green-fg);
  background: var(--green-muted);
  border-color: var(--green);
}

.badge-danger {
  color: var(--red-fg);
  background: var(--red-muted);
  border-color: var(--red);
}

.badge-neutral {
  color: var(--text-secondary);
  background: transparent;
  border-color: var(--border);
}

/* === IP LIST === */
.ip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.ip-row:hover {
  border-color: var(--border-hover);
}

.ip-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === SECTION === */
.section {
  padding: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* === STATUS MESSAGE === */
.status-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

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

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

/* === ALERTS === */
#alert-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.alert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  animation: slideIn 0.2s ease-out;
}

.alert-success { border-left-color: var(--green); }
.alert-error { border-left-color: var(--red); }
.alert-warning { border-left-color: var(--yellow); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* === LOGIN PAGE === */
.login-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}
