@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --bg-main: #f6f6f2;
  --bg-accent: #eef6f0;
  --card: #ffffff;
  --ink: #1b2320;
  --ink-muted: #5c6b64;
  --accent: #1f6b5a;
  --accent-strong: #174d41;
  --border: rgba(25, 44, 36, 0.16);
  --shadow: 0 18px 40px rgba(17, 28, 23, 0.08);
  --focus: #f3c96b;
}

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

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0)
    ),
    linear-gradient(135deg, var(--bg-main), var(--bg-accent));
  min-height: 100vh;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: grid;
  gap: 24px;
  animation: rise-in 0.5s ease-out;
}

.topbar {
  display: flex;
  justify-content: flex-end;
}

.lang-switch {
  display: flex;
  gap: 10px;
}

.lang-button {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.lang-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.lang-button[aria-pressed="true"] {
  box-shadow: 0 10px 20px rgba(31, 107, 90, 0.18);
  transform: translateY(-1px);
}

.lang-button:focus-visible {
  outline: 3px solid rgba(243, 201, 107, 0.6);
  outline-offset: 2px;
}

.flag {
  width: 36px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(17, 28, 23, 0.08);
}

.flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flag--text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
}

.lang-button[aria-pressed="true"] .flag {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(31, 107, 90, 0.2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.intro {
  display: grid;
  gap: 10px;
}

.intro h1 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0;
}

.intro p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 560px;
}

.support {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.panel {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.panel__status {
  font-size: 0.95rem;
  color: var(--ink-muted);
  min-height: 1.3rem;
}

.panel__status.error {
  color: #8a2f2f;
}

.panel__status.success {
  color: var(--accent);
}

.panel__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.search {
  flex: 1;
  min-width: 220px;
  display: grid;
  gap: 8px;
}

.search__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.search input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  outline: none;
  background: #fdfcf9;
}

.search input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(243, 201, 107, 0.25);
}

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

.idp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
  scroll-padding-top: 10px;
  scroll-padding-bottom: 10px;
  scroll-behavior: smooth;
}

.idp-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fbfbf8;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.idp-item.selected {
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(31, 107, 90, 0.14);
}

.idp-item:hover {
  border-color: rgba(31, 107, 90, 0.5);
}

.idp-label {
  display: grid;
  gap: 4px;
  cursor: pointer;
  position: relative;
}

.idp-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}

.idp-primary {
  font-size: 1rem;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

button {
  font-family: inherit;
  font-size: 0.98rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:focus-visible {
  outline: 3px solid rgba(243, 201, 107, 0.6);
  outline-offset: 2px;
}

button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 20px rgba(31, 107, 90, 0.2);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button.primary:not(:disabled):hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

button.ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(19, 41, 35, 0.08);
}

@media (max-width: 720px) {
  .page {
    padding: 28px 16px 40px;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
