/* _theme.html loads AFTER this stylesheet and redeclares --gk-primary in
   :root, so we need !important + a selector that also wins in dark mode. */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
  --gk-primary:       #E30613 !important;
  --gk-primary-hover: #b8050f !important;
  --accent:           #E30613 !important;
  --accent-hover:     #b8050f !important;
  --gk-connect-width: min(560px, calc(100vw - 32px));

  /* Warm reddish palette overrides — softens the cool default greys into
     tinted warm tones that harmonise with the INRED red. */
  --gk-bg:            #fdf6f6 !important;
  --gk-bg-surface:    #ffffff !important;
  --gk-text:          #2a1414 !important;
  --gk-text-muted:    #8c6b6b !important;
  --gk-border:        #ead8d8 !important;

  /* Ripple & glow tokens used by our own rules below */
  --inred-glow-soft:  0 1px 2px rgba(227,6,19,.08);
  --inred-glow-mid:   0 4px 14px rgba(227,6,19,.18);
  --inred-glow-hi:    0 10px 32px rgba(227,6,19,.25);
}

/* ── Page canvas: warm gradient backdrop with a faint red halo behind the card ── */
html, body {
  background:
    radial-gradient(1200px 600px at 50% 38%, rgba(227,6,19,.10), transparent 70%),
    linear-gradient(180deg, #fff7f7 0%, #fde9e9 100%) !important;
  background-attachment: fixed !important;
}

/* ── Card: warmer surface, red-tinted shadow and hairline border ── */
.gk-connect-overlay {
  border: 1px solid #f1dede !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 24px 60px -16px rgba(227,6,19,.22),
    0 8px 24px -12px rgba(70,20,20,.18) !important;
}

/* ── Inputs: tinted idle state, rich red focus ring ── */
.gk-connect-form .gk-connect-field > input {
  background: #fbf4f4;
  border: 1px solid var(--gk-border);
  color: var(--gk-text);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.gk-connect-form .gk-connect-field > input::placeholder { color: #b39696; }
.gk-connect-form .gk-connect-field > input:hover { background: #fff; border-color: #e0c6c6; }
.gk-connect-form .gk-connect-field > input:focus {
  background: #fff;
  border-color: var(--gk-primary, #E30613);
  box-shadow: 0 0 0 3px rgba(227,6,19,.12);
  outline: none;
}

/* ── Divider: warmer line gradient, condensed "ou" glyph ── */
.gk-connect-divider { color: #a88787 !important; }
.gk-connect-divider::before,
.gk-connect-divider::after {
  background: linear-gradient(90deg, transparent, #ead8d8, transparent) !important;
  height: 1px !important;
}

/* ── Submit button: red glow lift on hover, tactile press on active ── */
.gk-connect-form .gk-connect-submit {
  box-shadow: var(--inred-glow-mid);
  transition:
    background .18s ease,
    box-shadow .28s ease,
    transform  .12s ease,
    max-height 1000ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity     800ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-top 1000ms cubic-bezier(0.22, 1, 0.36, 1),
    padding    1000ms cubic-bezier(0.22, 1, 0.36, 1);
}
.gk-connect-form .gk-connect-submit:hover {
  box-shadow: var(--inred-glow-hi);
  transform: translateY(-1px);
}
.gk-connect-form .gk-connect-submit:active {
  transform: translateY(0);
  box-shadow: var(--inred-glow-soft);
}

/* Logo ~5x larger than before — !important needed because connect.css loads
   later and fixes img at 44x44. Card width is set via --gk-connect-width above. */
.gk-connect-logo { padding: 48px 24px 12px; }
.gk-connect-logo img {
  width: auto !important;          /* JS overrides to match Gmail button width */
  height: auto !important;         /* let aspect ratio determine height */
  max-width: 100% !important;
  object-fit: contain !important;
  border-radius: 4px !important;   /* match the button corner radius */
}

/* Dedicated login page — drop the modal's title bar (title + × close).
   connect.css loads AFTER us and sets display: flex, so !important is needed. */
.gk-connect-head { display: none !important; }

/* ── Full-page "Connexion en cours…" overlay shown while Google's popup is open ── */
.inred-signing {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  z-index: 20000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 340ms cubic-bezier(0.22, 1, 0.36, 1);
}
.inred-signing.is-visible { opacity: 1; pointer-events: auto; }
.inred-signing img {
  width: auto; height: 260px; max-width: 80%;
  animation: inred-breathe 1.8s ease-in-out infinite;
}
.inred-signing-text {
  margin-top: 28px;
  font-size: 15px; font-weight: 500;
  letter-spacing: .05em;
  color: var(--gk-primary, #E30613);
}
@keyframes inred-breathe {
  0%, 100% { transform: scale(1);   filter: drop-shadow(0 0 0 rgba(227,6,19,0)); }
  50%      { transform: scale(1.03); filter: drop-shadow(0 0 22px rgba(227,6,19,.35)); }
}

/* ── Tiny red ripple under the Gmail click ── */
.gk-connect-google { position: relative; overflow: hidden; }
.inred-ripple {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(227,6,19,.28);
  pointer-events: none;
  animation: inred-ripple 650ms ease-out forwards;
}
@keyframes inred-ripple {
  to { transform: translate(-50%, -50%) scale(45); opacity: 0; }
}

/* Placeholder serves as label for both fields — hide the span above inputs */
.gk-connect-form label:has(input[name="email"]) > span,
.gk-connect-form label:has(input[name="password"]) > span { display: none; }

/* Both buttons centered. GSI renders at its own width; JS mirrors that width
   onto the submit + email/password inputs so they're pixel-identical. */
.gk-connect-google { display: flex; justify-content: center; }
.gk-connect-form label { align-items: center; }

/* Inputs match the button size: same 40px height, 4px corners, 14/500 font. */
.gk-connect-form .gk-connect-field > input {
  margin: 0 auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
}

.gk-connect-form .gk-connect-submit {
  width: 320px;
  max-width: 100%;
  align-self: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* "Zen" reveal — long expo-out easing, fade + soft scale + slide.
   Applied to both the password row and the submit button. */
.gk-connect-form label:has(input[name="password"]),
.gk-connect-form .gk-connect-submit {
  overflow: hidden;
  max-height: 80px;
  opacity: 1;
  transform: translateY(0) scale(1);
  margin-top: 0;
  transition:
    max-height 1000ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity     800ms cubic-bezier(0.22, 1, 0.36, 1),
    transform  1000ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-top 1000ms cubic-bezier(0.22, 1, 0.36, 1),
    padding    1000ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gk-connect-form label:has(input[name="password"]).inred-pwd-hidden,
.gk-connect-form .gk-connect-submit.inred-pwd-hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  margin-top: -8px;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* Section headings injected by login.js above each sign-in path */
.inred-section-h {
  padding: 10px 20px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gk-text-muted, #6b7280);
}

