@import url("/static/fonts/comfortaa.css");

:root {
  --b33-accent: #3d8b6e;
  --b33-accent-soft: rgba(61, 139, 110, 0.18);
  --bg0: #f3efe8;
  --bg1: #e7f0ea;
  --ink: #1c2420;
  --muted: #5c6b64;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(28, 36, 32, 0.1);
  --shadow: 0 18px 50px rgba(28, 36, 32, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Comfortaa, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--b33-accent-soft), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 255, 255, 0.7), transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
}

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

.auth-shell, .profile-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px 40px;
}

.auth-card, .profile-card {
  width: min(420px, 100%);
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 18px;
}

.auth-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
}

.brand-name { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.brand-tagline { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

h1 { font-size: 1.55rem; margin: 0 0 16px; }
h2 { font-size: 1rem; margin: 0 0 12px; }

.field { display: block; margin-bottom: 12px; }
.field input, .stack input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 14px 16px;
  font: inherit;
  color: inherit;
  outline: none;
}
.field input:focus, .stack input:focus {
  border-color: var(--b33-accent);
  box-shadow: 0 0 0 3px var(--b33-accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.btn.primary {
  width: 100%;
  background: var(--b33-accent);
  color: #fff;
  margin-top: 4px;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1; min-width: 120px; }

.auth-switch { text-align: center; color: var(--muted); margin: 18px 0 0; }
.auth-switch a { color: var(--b33-accent); font-weight: 700; text-decoration: none; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0 12px;
}
.oauth-label { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; text-align: center; }
.oauth-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
}
.oauth-btn:hover { border-color: var(--b33-accent); }

.error-banner {
  background: #ffe8e4;
  color: #8a2f22;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.muted { color: var(--muted); }
.profile-top {
  width: min(420px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 14px;
}
.back-link, .brand-mini {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.brand-mini img { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; }

.profile-hero { text-align: center; margin-bottom: 18px; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; background: var(--b33-accent-soft);
  border: 3px solid rgba(255,255,255,0.8);
}
.panel {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.panel.quiet { border-top: 1px solid var(--line); }
.stack { display: grid; gap: 10px; }
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.avatar-opt {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 4px;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
}
.avatar-opt.is-selected { border-color: var(--b33-accent); }
.avatar-opt img { width: 100%; aspect-ratio: 1; border-radius: 10px; display: block; }
.logout-confirm { margin-top: 10px; }
.toast {
  position: sticky;
  bottom: 8px;
  margin-top: 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

@media (max-width: 480px) {
  .auth-card, .profile-card { padding: 22px 16px 18px; }
  .auth-logo { width: 64px; height: 64px; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
}
