/* Squiggle Team Portal — on-brand styling
   Squiggle Green #00CE3F · Light green tint #E5FAEB · DM Serif headings · Manrope body */
:root {
  --green: #00CE3F;
  --green-dark: #00a833;
  --green-text: #0b6b2e;   /* readable green for text on white (WCAG AA) */
  --ink: #111813;
  --muted: #5d6b62;
  --tint: #E5FAEB;       /* light green tint */
  --line: #dce7e0;
  --bg: #ffffff;
  --card: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;   /* avoids the iOS Safari address-bar gap */
  display: flex;
  flex-direction: column;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
h1 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }

/* ---------- LOGIN ---------- */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--tint), #ffffff 60%);
}
.login-card {
  background: var(--card);
  width: 100%;
  max-width: 420px;
  padding: 44px 38px 32px;
  border-radius: 18px;
  box-shadow: 0 14px 50px rgba(0, 90, 30, 0.10);
  text-align: center;
  border: 1px solid var(--line);
}
.logo { max-width: 170px; height: auto; margin: 0 auto 18px; display: block; }
.wordmark {
  font-family: "DM Serif Display", Georgia, serif;
  color: var(--green);
  font-size: 40px;
  line-height: 1;
  margin-bottom: 14px;
}
.login-card h1 { font-size: 30px; margin: 4px 0 10px; color: var(--ink); }
.login-card .sub { color: var(--muted); font-size: 15px; margin: 0 0 26px; line-height: 1.55; }
/* Official "Sign in with Google" button (per Google's branding guidelines) */
.gsi-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #747775;
  border-radius: 10px;
  font-family: "Roboto", "Manrope", -apple-system, sans-serif;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.gsi-btn:hover { background: #f7f8f7; box-shadow: 0 1px 3px rgba(60,64,67,0.16); }
.gsi-icon { display: flex; align-items: center; }
.tagline {
  font-family: "DM Serif Display", Georgia, serif;
  color: var(--green-text);
  font-size: 15px;
  margin: 26px 0 0;
  line-height: 1.45;
}
.foot { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fda29b;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: left;
}

/* ---------- DASHBOARD ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.topbar-logo { height: 30px; width: auto; display: block; }
.brand {
  font-family: "DM Serif Display", Georgia, serif;
  color: var(--green);
  font-size: 24px;
}
.brand-sub { color: var(--muted); font-size: 14px; font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 12px; }
.avatar { width: 31px; height: 31px; border-radius: 50%; object-fit: cover; }
.avatar-fallback {
  width: 31px; height: 31px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.user-name { font-size: 14px; color: var(--ink); font-weight: 600; }
.logout {
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 700;
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 9px;
}
.logout:hover { background: var(--tint); border-color: var(--green); }

.dash-wrap { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 44px 24px; }
.dash-wrap h1 { font-size: 34px; margin: 0 0 6px; color: var(--ink); }
.dash-sub { color: var(--muted); margin: 0 0 32px; font-size: 16px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  display: block;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 90, 30, 0.10);
  border-color: var(--green);
}
.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.tile-icon svg { width: 24px; height: 24px; }
.tile:hover .tile-icon { background: var(--green); color: #fff; }
.tile-title { font-weight: 700; font-size: 17px; margin-bottom: 6px; color: var(--ink); }
.tile-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- TEAM HUB ---------- */
.hub { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 40px 24px; }
.hub-hi { font-size: 32px; margin: 0 0 2px; color: var(--ink); }
.hub-date { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.hub-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 15px;
  height: 46px;
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 520px;
}
.hub-search {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  height: 100%;
}
.hub-search::placeholder { color: var(--muted); }

.hub-section { margin-bottom: 26px; }
.section-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 12px;
}
.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 18px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.app:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 90, 30, 0.10);
  border-color: var(--green);
}
.app.featured { border: 2px solid var(--green); }
.app-badge {
  position: absolute;
  top: 11px;
  right: 11px;
  background: var(--tint);
  color: var(--green-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 3px 7px;
  border-radius: 6px;
}
.app-count {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--green);
  color: #06381a;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 10px;
}
.app-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-ic svg { width: 23px; height: 23px; }
.app-ic-dark { background: #0b3d1d; color: #fff; }
.app:hover .app-ic:not(.app-ic-dark) { background: var(--green); color: #fff; }
.app-title { font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.25; }
.app-sub { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: -2px; }
.hub-empty { color: var(--muted); font-size: 14px; padding: 8px 2px; }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; background: var(--tint); }
.site-footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-meta { color: var(--muted); font-size: 13px; line-height: 1.6; }
.footer-social { display: flex; gap: 16px; }
.footer-social img { width: 18px; height: 18px; opacity: 0.65; transition: opacity 0.15s ease; }
.footer-social a:hover img { opacity: 1; }
.footer-copy {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 22px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- MOBILE / TABLET ---------- */
@media (max-width: 600px) {
  .login-card { padding: 32px 22px 24px; border-radius: 16px; }
  .login-card h1 { font-size: 26px; }
  .wordmark { font-size: 34px; }

  .topbar-inner { padding: 12px 16px; gap: 10px; }
  .brand { font-size: 20px; }
  .topbar-logo { height: 26px; }
  .brand-sub { display: none; }
  .user-name { display: none; }     /* keep the avatar; name returns on wider screens */
  .user-box { gap: 10px; }

  .dash-wrap { padding: 30px 18px; }
  .dash-wrap h1 { font-size: 27px; }
  .dash-sub { font-size: 15px; margin-bottom: 24px; }
  .tiles { grid-template-columns: 1fr; gap: 14px; }

  .hub { padding: 28px 18px; }
  .hub-hi { font-size: 27px; }
  .apps { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

  .site-footer-inner { padding: 20px 18px; gap: 14px; }
  .footer-copy { padding: 0 18px 20px; }
}

/* Comfortable touch targets on all devices */
@media (pointer: coarse) {
  .logout { padding: 10px 14px; }
}

/* Visible keyboard focus for accessibility */
a:focus-visible,
.gsi-btn:focus-visible,
.tile:focus-visible,
.logout:focus-visible {
  outline: 3px solid var(--green-text);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tile:hover, .gsi-btn:hover { transform: none; }
}
