@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f4f0;
  --bg-2: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #f6f3ed;
  --ink: #121417;
  --muted: #6b7280;
  --brand: #0f766e;
  --brand-2: #0d5c55;
  --accent: #c9862b;
  --stroke: rgba(15, 23, 42, 0.12);
  --shadow: 0 20px 60px rgba(24, 28, 38, 0.14);
  --focus: 0 0 0 4px rgba(15, 118, 110, 0.18);
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(15, 118, 110, 0.18), transparent 60%),
    radial-gradient(700px 460px at 92% 0%, rgba(201, 134, 43, 0.14), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--ink);
  padding: 32px 24px 60px;
}

.auth-shell {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.auth-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
  box-shadow: 0 0 16px rgba(63, 185, 80, 0.4);
}
.auth-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
}

.auth-brand-text strong {
  display: block;
  font-size: 1rem;
}

.auth-brand-text span {
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-home {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.locale-toggle {
  display: flex;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  overflow: hidden;
}
.locale-toggle button {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  letter-spacing: 0.02em;
}
.locale-toggle button:hover {
  color: var(--ink);
  background: var(--stroke);
}
.locale-toggle button.active {
  color: var(--ink);
  background: var(--surface-2);
}

.card {
  width: min(560px, 92vw);
  padding: 32px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

h2 {
  margin: 0 0 12px;
  font-size: 30px;
  font-family: 'Fraunces', 'Iowan Old Style', serif;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 24px;
  color: var(--muted);
}

.auth-card {
  animation: authIn 280ms ease;
}

@keyframes authIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

label {
  display: block;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  font-size: 1rem;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}

select {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  font-size: 1rem;
  background: #fff;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}

select:focus {
  outline: none;
  border-color: rgba(31, 122, 111, 0.45);
  box-shadow: var(--focus);
}

input:focus {
  outline: none;
  border-color: rgba(31, 122, 111, 0.45);
  box-shadow: var(--focus);
}

button {
  border: 1px solid var(--brand);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(24, 28, 38, 0.12);
  background: var(--brand-2);
  border-color: var(--brand-2);
}

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

.ghost:hover {
  background: var(--surface-2);
  border-color: var(--stroke);
  color: var(--brand-2);
}

.ghost.small {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.oauth {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  background: var(--surface-2);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.oauth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(24, 28, 38, 0.12);
  border-color: rgba(31, 122, 111, 0.35);
}

.oauth-btn.google {
  background: #fff;
}

.oauth-btn.github {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.divider {
  position: relative;
  margin: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--stroke);
  transform: translateY(-50%);
}

.divider span {
  position: relative;
  background: var(--surface);
  padding: 0 10px;
}

.row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.org-chooser {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(31, 122, 111, 0.35);
  background: var(--surface-2);
}

#msg {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  font-size: 0.95rem;
}

#msg.info { color: var(--muted); }
#msg.warn { color: var(--accent); }
#msg.error { color: #b42318; }

#msg a {
  color: inherit;
}

#msg .small {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-radius: 10px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--brand);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .auth-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .auth-card { padding: 24px 16px; border-radius: var(--radius-sm, 12px); }
  .auth-header { gap: 8px; }
  .oauth { flex-direction: column; }
}
