@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.65);
  --card: rgba(15, 23, 42, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #f43f5e;
  --success: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, #1d4ed8, #020617 55%);
  min-height: 100vh;
  color: var(--text);
}

.public-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(134, 239, 172, 0.35), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(16, 185, 129, 0.35), transparent 55%),
    linear-gradient(135deg, #032019, #065f46 65%, #022c22);
  padding: 2rem 1rem;
}

.public-shell__inner {
  width: 100%;
  max-width: 520px;
}

.public-flash-list {
  margin-bottom: 1.5rem;
}

.public-auth-card {
  text-align: center;
  background: rgba(2, 32, 25, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 32px;
  padding: 2.25rem 2rem;
  box-shadow: 0 50px 120px -55px rgba(2, 44, 34, 0.95);
}

.public-auth-logo {
  width: 190px;
  height: 190px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 35px 55px -35px rgba(15, 23, 42, 0.6);
}

.public-auth-logo img {
  max-width: 130px;
  max-height: 130px;
  display: block;
}

.public-auth-card h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.public-auth-notice {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.35rem;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.95rem;
}

.public-auth-notice strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.public-auth-notice a {
  color: var(--accent);
  font-weight: 600;
}

.public-auth-subtitle {
  margin: 0.35rem 0 1.5rem;
  color: var(--muted);
}

.public-auth-card form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}

.public-role-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.public-role-button {
  display: block;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(3, 30, 23, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.public-role-button h2 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
}

.public-role-button p {
  margin: 0;
  color: var(--muted);
}

.toggle-group {
  display: flex;
  gap: 0.75rem;
}

.toggle-option {
  flex: 1;
  position: relative;
}

.toggle-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.toggle-option span {
  display: block;
  padding: 0.75rem 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(3, 30, 23, 0.75);
  text-align: center;
  font-weight: 600;
}

.toggle-option input:checked + span {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(74, 222, 128, 0.8);
  color: #bbf7d0;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.25);
}

.radio-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.radio-option {
  flex: 1 1 120px;
  position: relative;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 0.65rem 0.75rem 0.65rem 2.5rem;
  background: rgba(3, 30, 23, 0.75);
}

.radio-option input {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
}

.radio-option span {
  font-weight: 600;
}

.radio-option input:checked + span {
  color: #bbf7d0;
}

.public-auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  background: linear-gradient(120deg, #0f9d58, #34d399);
  color: #032012;
  border: none;
  box-shadow: 0 18px 40px rgba(15, 157, 88, 0.35);
}

.public-auth-links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.public-auth-link {
  color: #6ee7b7;
  font-weight: 600;
}

.public-auth-link:hover {
  color: #86efac;
}

.public-help-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.35);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.public-help-link:hover {
  border-color: rgba(134, 239, 172, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.2);
}

.public-help-link:focus-visible {
  outline: 2px solid rgba(134, 239, 172, 0.8);
  outline-offset: 2px;
}

.public-help-link:active {
  transform: translateY(0);
}

.public-auth-meta {
  margin-top: 1.5rem;
  color: var(--muted);
}

.public-auth-meta a {
  font-weight: 600;
}

.single-action-form {
  margin-top: 1.5rem;
}

.single-action-form button {
  width: 100%;
}

.public-auth-data {
  margin: 1.5rem 0 0;
  padding: 1.4rem;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.public-auth-data dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 0.75rem;
}

.public-auth-data dt:first-of-type {
  margin-top: 0;
}

.public-auth-data dd {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--accent-strong);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(2, 6, 23, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-bar nav a {
  margin-left: 1.25rem;
  color: var(--muted);
  font-weight: 500;
}

.top-bar nav a:hover,
.top-bar nav a.active {
  color: var(--accent);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 2.25rem;
  box-shadow: 0 60px 120px -50px rgba(2, 6, 23, 0.9);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  padding: 1.5rem;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.card h3 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.card .stat {
  font-size: 2.35rem;
  font-weight: 600;
  margin: 0.35rem 0 0;
}

.section {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  padding: 0.85rem 0.5rem;
}

.table td {
  padding: 0.95rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

form.inline {
  display: inline;
}

.flash-list {
  list-style: none;
  padding: 0;
}

.flash {
  margin: 0.5rem 0;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.flash.success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.flash.error {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
}

.popout-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.popout {
  border-radius: 22px;
  padding: 1rem 1.25rem;
  background: rgba(2, 32, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 5px solid var(--accent);
  box-shadow: 0 25px 50px -30px rgba(2, 44, 34, 0.8);
  animation: pop-slide 200ms ease;
}

.popout__label {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.popout__message {
  margin: 0;
  color: var(--text);
}

.popout--error {
  border-left-color: var(--danger);
}

.popout--success {
  border-left-color: var(--success);
}

.popout--warning {
  border-left-color: #facc15;
}

.popout--info {
  border-left-color: var(--accent);
}

@keyframes pop-slide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

/* WISPr portal tweaks */
.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(2, 6, 23, 0.35);
  color: var(--text);
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: rgba(134, 239, 172, 0.8);
  box-shadow: 0 0 0 2px rgba(134, 239, 172, 0.2);
}

.password-field {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0.5rem;
}

.password-field .form-control {
  padding-right: 1rem;
}

.password-toggle {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0 0.95rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--text);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.password-toggle:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(74, 222, 128, 0.7);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(134, 239, 172, 0.8);
  outline-offset: 2px;
}

.password-toggle:active {
  transform: scale(0.98);
}

.connection-details {
  margin-top: 1.75rem;
  color: var(--text);
}


.connection-details summary {
  cursor: pointer;
  color: var(--accent);
  margin-bottom: 0.9rem;
  font-weight: 600;
}

.connection-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.connection-chip {
  border-radius: 18px;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 90px;
}

.connection-chip span {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.connection-chip strong {
  font-size: 1.05rem;
  word-break: break-all;
}


.connection-chip--wide {
  grid-column: span 2;
}

.contact-chip {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 24px;
  border: 1px solid rgba(134, 239, 172, 0.5);
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.18);
  font-weight: 600;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.2);
}

.contact-chip__icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.result-card {
  text-align: center;
}

.form-field label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input,
select,
button,
textarea {
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 6, 23, 0.4);
  color: var(--text);
  font-size: 1rem;
}

button {
  background: linear-gradient(125deg, #0ea5e9, #22d3ee);
  border: none;
  color: #082f49;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(14, 165, 233, 0.35);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(14, 165, 233, 0.4);
}

button.danger {
  background: linear-gradient(125deg, #fb7185, #f97316);
  color: #fff;
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.35);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.15);
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0.1rem 0.2rem;
}

.section + .section {
  backdrop-filter: blur(4px);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

code {
  background: rgba(15, 23, 42, 0.7);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .public-shell {
    padding: 1.25rem;
  }

  .public-shell__inner {
    max-width: 100%;
  }

  .public-auth-card {
    border-radius: 24px;
    padding: 1.5rem 1.25rem;
  }

  .public-auth-logo {
    width: 140px;
    height: 140px;
  }

  .public-auth-card form {
    gap: 0.75rem;
  }

  .connection-grid {
    grid-template-columns: 1fr;
  }

  .connection-chip--wide {
    grid-column: span 1;
  }
}
