:root {
  --bg0: #f3f5f7;
  --ink: #101820;
  --muted: #5b6775;
  --silver: #3d4a57;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --line: rgba(16, 24, 32, 0.12);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Syne", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg0);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(15, 118, 110, 0.12), transparent 55%),
    linear-gradient(180deg, #f7f8fa, var(--bg0) 55%, #eef1f4);
  background-attachment: fixed;
}

.invite {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem 3rem;
  animation: rise 0.5s ease both;
}

.invite::before {
  content: "";
  width: 48px;
  height: 4px;
  margin-bottom: 1.6rem;
  background: linear-gradient(90deg, var(--accent), #14b8a6);
  border-radius: 2px;
}

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

.brand {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  margin: 0 0 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
}

.sub {
  margin: 0 0 2.15rem;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.gmail-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 8px;
  padding: 0.9rem 1.45rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.28);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.gmail-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #0d9488;
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.35);
}

.gmail-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.gmail-btn.secondary {
  margin-top: 0.75rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.status {
  margin: 1.5rem 0 0;
  color: var(--muted);
  max-width: 34ch;
  line-height: 1.45;
}

.status.busy::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1s ease infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.result {
  margin: 1rem 0 0;
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  background: #ccfbf1;
  color: #115e59;
  font-weight: 700;
  border: 1px solid rgba(15, 118, 110, 0.25);
}

.result.error {
  background: #fff1f2;
  color: #9f1239;
  border-color: rgba(159, 18, 57, 0.2);
}

.dash-link {
  margin-top: 2.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.dash-link:hover { color: var(--accent); }

/* Google popup — keep white Glif chrome */
.gpopup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: modalIn 0.2s ease both;
}

.gpopup[hidden] {
  display: none !important;
}

.gpopup.is-preload {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.gpopup.is-preload .gpopup__backdrop {
  display: none;
}

@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gpopup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 32, 0.55);
}

.gpopup__window {
  position: relative;
  z-index: 1;
  width: min(450px, 100%);
  height: calc(100vh - 0.5rem);
  max-height: 820px;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  color: #202124;
  box-shadow:
    0 1px 3px rgba(60, 64, 67, 0.3),
    0 4px 8px 3px rgba(60, 64, 67, 0.15),
    0 24px 48px rgba(0, 0, 0, 0.28);
  animation: panelRise 0.25s ease both;
  font-family: "Google Sans", "Manrope", Arial, sans-serif;
}

@keyframes panelRise {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.gpopup__titlebar {
  display: grid;
  grid-template-columns: 54px 1fr 36px;
  align-items: center;
  height: 38px;
  padding: 0 8px;
  background: #f1f3f4;
  border-bottom: 1px solid #dadce0;
  flex-shrink: 0;
}

.gpopup__traffic {
  display: flex;
  gap: 6px;
  padding-left: 4px;
}

.gpopup__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.gpopup__dot--red {
  background: #ff5f57;
  cursor: pointer;
}
.gpopup__dot--yellow { background: #febc2e; }
.gpopup__dot--green { background: #28c840; }

.gpopup__title {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #3c4043;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gpopup__x {
  border: 0;
  background: transparent;
  color: #5f6368;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.gpopup__x:hover {
  background: #e8eaed;
}

.gpopup__body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gpopup__main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  background: #fff;
}

.gpopup__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #5f6368;
  font-size: 14px;
  background: #fff;
}

.gpopup__loading[hidden],
.gpopup__frame[hidden] {
  display: none !important;
}

.gpopup__frame {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  min-width: 0;
}

.gpopup__frame--waiting {
  opacity: 0;
  pointer-events: none;
}

.gpopup__glif {
  width: min(100%, 360px);
  padding: 2rem 1.5rem;
  text-align: center;
}

.gpopup__glif-title {
  margin: 1rem 0 0.25rem;
  font-size: 24px;
  font-weight: 400;
  color: #202124;
}

.gpopup__glif-sub {
  margin: 0 0 1.5rem;
  font-size: 14px;
  color: #5f6368;
}

.gpopup__spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid #e8eaed;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: gspin 0.7s linear infinite;
}

@keyframes gspin {
  to { transform: rotate(360deg); }
}

.gpopup__foot {
  display: none;
}

@media (max-width: 540px) {
  .gpopup {
    padding: 0;
    align-items: stretch;
  }
  .gpopup__window {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}
