/* Minimal, clean styling. Swap later for the C21 brand palette. */

:root {
  --c21-gold: #beaf87;
  --c21-black: #1a1a1a;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --border: #e3e0d6;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --danger: #b23b3b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--c21-black); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: -8px -8px;
  background: var(--c21-black);
  color: #fff;
  border-bottom: 3px solid var(--c21-gold);
}
.site-header .brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  height: 96px;
  width: auto;
}
.site-header .user-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d8d8d8;
  text-decoration: none;
  padding: 3px 14px 3px 3px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.user-pill:hover {
  background: #2b2b2b;
  color: #fff;
}
.user-email {
  line-height: 1;
}
.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  flex-shrink: 0;
}
.user-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c21-gold);
  color: var(--c21-black);
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.site-main {
  max-width: 1080px;
  margin: 40px auto;
  padding: 0 24px;
}

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

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

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--c21-black);
  color: #fff;
}
.btn-primary:hover { background: #2b2b2b; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: #4a4a4a;
}
.btn-ghost:hover { background: #2b2b2b; }
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-danger {
  color: var(--danger);
  border-color: #f1c7c7;
  background: var(--surface);
}
.btn-danger:hover {
  background: #fbecec;
  color: var(--danger);
}
.btn-google::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -3px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path fill='%23FFC107' d='M43.6 20.5H42V20H24v8h11.3C33.8 32 29.3 35 24 35c-6.1 0-11-4.9-11-11s4.9-11 11-11c2.8 0 5.4 1.1 7.4 2.8l5.7-5.7C33.6 7 29 5 24 5 13.5 5 5 13.5 5 24s8.5 19 19 19c10.5 0 19-8.5 19-19 0-1.2-.1-2.3-.4-3.5z'/><path fill='%23FF3D00' d='M6.3 14.7l6.6 4.8C14.6 16 18.9 13 24 13c2.8 0 5.4 1.1 7.4 2.8l5.7-5.7C33.6 7 29 5 24 5 16.3 5 9.7 9.3 6.3 14.7z'/><path fill='%234CAF50' d='M24 43c5 0 9.5-1.9 12.9-5.1l-6-5.1C29 34.4 26.6 35 24 35c-5.3 0-9.8-3-11.3-7l-6.5 5C9.6 38.7 16.3 43 24 43z'/><path fill='%231976D2' d='M43.6 20.5H42V20H24v8h11.3c-.7 2-2 3.7-3.7 5l6 5.1C40.3 35.5 43 30.2 43 24c0-1.2-.1-2.3-.4-3.5z'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

.login-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 { margin: 0 0 8px; }
.login-card .btn { margin: 20px 0; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin: 12px 0;
  text-align: left;
}
.alert-error {
  background: #fbecec;
  color: var(--danger);
  border: 1px solid #f1c7c7;
}

.welcome h1 { margin-bottom: 4px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
}
.tool-card h2 { margin: 0; font-size: 18px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }

.tag {
  align-self: flex-start;
  background: var(--c21-gold);
  color: var(--c21-black);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Profile page ─────────────────────────────────── */

.profile-page {
  max-width: 780px;
  margin: 0 auto;
}
.profile-page h1 {
  margin-bottom: 24px;
}

.profile-layout {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.profile-picture-section {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.avatar-preview {
  width: 128px;
  height: 128px;
}

.avatar-large {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder {
  background: var(--c21-gold);
  color: var(--c21-black);
  font-weight: 700;
  font-size: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.file-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c21-black);
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: background 0.15s ease;
  text-align: center;
}
.file-label:hover {
  background: var(--bg);
}
.file-input {
  display: none;
}

.profile-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 280px;
}

.profile-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease;
}
.form-group input:focus {
  outline: none;
  border-color: var(--c21-gold);
}
.input-disabled {
  background: #eae7e0;
  color: var(--muted);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

/* ── Admin page ───────────────────────────────────── */

.admin-page {
  max-width: 860px;
  margin: 0 auto;
}
.admin-page h1 {
  margin-bottom: 28px;
}

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.admin-section h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.profile-row-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}
.profile-row-actions {
  display: flex;
  gap: 8px;
}

.whitelist-form {
  margin-bottom: 12px;
}
.form-row {
  display: flex;
  gap: 10px;
}
.form-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
}
.form-row input:focus {
  outline: none;
  border-color: var(--c21-gold);
}

.whitelist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.whitelist-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px 4px 14px;
  font-size: 13px;
}
.form-inline {
  display: inline;
}
.form-inline .btn {
  padding: 2px 8px;
  font-size: 12px;
}
