:root {
  --bg: #f5f8fb;
  --card: #ffffff;
  --ink: #1a2b3b;
  --muted: #607286;
  --brand: #0f6bb5;
  --brand-2: #0b4c82;
  --ok: #117a3f;
  --warn: #9a5a00;
  --danger: #b42318;
  --border: #d9e3ee;
  --shadow: 0 10px 24px rgba(13, 35, 67, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--brand-2);
  letter-spacing: 0.2px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f6bb5, #15a0a3);
}

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

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.title {
  margin: 4px 0 14px;
  font-size: 24px;
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 14px;
  color: var(--muted);
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 107, 181, 0.25);
  border-color: var(--brand);
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button,
.button {
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--brand-2);
  border-color: var(--border);
}

button.warn {
  background: #fff6ec;
  border-color: #f4d7a8;
  color: var(--warn);
}

button.danger {
  background: #fff1f1;
  border-color: #f7c3c3;
  color: var(--danger);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 8px;
  font-size: 13px;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

.card-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.pill {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  background: #f7fbff;
  color: var(--brand-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

@media (max-width: 920px) {
  .grid,
  .grid-3,
  .row {
    grid-template-columns: 1fr;
  }
}

/* Login page only */
.login-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: #122a41;
  background:
    radial-gradient(circle at 12% 10%, #dcedff 0, #dcedff 18%, transparent 50%),
    radial-gradient(circle at 90% 88%, #ddfff0 0, #ddfff0 14%, transparent 42%),
    linear-gradient(160deg, #f7fbff 0%, #edf4ff 50%, #f8fbfd 100%);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: min(460px, 100%);
  border-radius: 20px;
  border: 1px solid #c9d9e8;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(13, 39, 64, 0.14);
}

.login-form-panel {
  padding: 30px 28px 24px;
}

.login-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: #12395e;
  background: linear-gradient(140deg, #c5f7ff, #9df1d7);
  box-shadow: inset 0 0 0 1px rgba(12, 53, 88, 0.12);
}

.login-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-heading h1 {
  margin: 2px 0 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 32px;
  line-height: 1.1;
  color: #0f2e4b;
}

.login-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #57708a;
}

.login-subtitle {
  margin: 10px 0 18px;
  color: #5f7489;
  font-size: 14px;
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  margin-bottom: 6px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 72px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 56px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #c7d7e8;
  background: #f7fbff;
  color: #184468;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4f6379;
  margin: 0;
}

.remember-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: #0a6ca5;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  border-radius: 11px;
  font-size: 15px;
  background: linear-gradient(130deg, #0a77bc, #0e936e);
  box-shadow: 0 8px 20px rgba(11, 118, 172, 0.25);
}

.login-submit:hover {
  filter: brightness(1.03);
}

.login-footnote {
  margin-top: 16px;
  font-size: 13px;
  color: #5f7287;
  line-height: 1.45;
}

.login-footnote a {
  color: #0a6ca5;
  text-decoration: none;
  font-weight: 600;
}

.login-footnote a:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .login-form-panel {
    padding: 24px 18px 20px;
  }

  .login-heading h1 {
    font-size: 30px;
  }

  .login-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Signup page */
.signup-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 36px;
}

.signup-card {
  width: min(1020px, 100%);
  border: 1px solid #c8d9ea;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(13, 41, 67, 0.14);
  padding: 26px;
}

.signup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.signup-header h1 {
  margin: 0 0 8px;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 31px;
  line-height: 1.15;
  color: #0f2b43;
}

.signup-header p {
  margin: 0;
  color: #5d7187;
}

.signup-login-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #c8d9ea;
  border-radius: 10px;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 600;
  color: #1f4f74;
  background: #f7fbff;
}

.signup-form {
  display: grid;
  gap: 14px;
}

.signup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signup-field label {
  display: block;
  margin-bottom: 6px;
}

.signup-panel {
  border: 1px solid #d3e2ef;
  border-radius: 14px;
  padding: 14px;
  background: #f9fcff;
}

.signup-panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #143a5b;
}

.signup-panel p {
  margin: 0 0 10px;
  color: #61758b;
  font-size: 13px;
}

.signup-success {
  margin-top: 16px;
  border: 1px solid #d3e2ef;
  border-radius: 14px;
  padding: 16px;
  background: #f9fcff;
}

.signup-success h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #143a5b;
}

.signup-success p {
  margin: 0 0 14px;
  color: #607487;
}

.signup-credentials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.signup-credential-item {
  border: 1px solid #d4e2f0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.signup-credential-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #5d7187;
}

.signup-credential-item code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #0f2b43;
}

.signup-code {
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d4e2f0;
  background: #fff;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .signup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signup-credentials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .signup-header {
    flex-direction: column;
  }

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