/* SSO JWT Portal — login UI, app selection, and API key claim views.
   Dependency-light vanilla CSS so assets upload cleanly as static files. */

:root {
  --bg: #0f172a;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.site-header {
  background: var(--bg);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.brand-mark {
  font-size: 1.25rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  color: #cbd5e1;
  text-decoration: none;
}

.site-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.form .field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

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

.btn.ghost:hover:not(:disabled) {
  background: var(--surface-muted);
}

.link-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.link-btn:hover {
  color: #fff;
  text-decoration: underline;
}

.status {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.status.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.status.success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.apps-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.app-row:first-child {
  border-top: none;
}

.app-info {
  min-width: 0;
}

.app-name {
  font-weight: 600;
}

.app-domain {
  color: var(--muted);
  font-size: 0.85rem;
  word-break: break-all;
}

.apikey-result {
  margin-top: 1rem;
}

.apikey-row {
  display: flex;
  gap: 0.5rem;
}

.apikey-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

code {
  background: var(--surface-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.site-footer {
  color: var(--muted);
  font-size: 0.85rem;
  justify-content: center;
}
