/* Connect guides and the "Connecting to..." card.
   Shared by the app (every page, partials/head/_stylesheets.html) and the
   brand portal (portal.html): same markup (templates/partials/modals/platforms/),
   same look. Moved out of profiles.css on 2026-10-29 so the portal can load
   them without the rest of the profiles page. Every token comes from menu.css,
   which the portal gets through publicTheme.css. */

/* MODALES DE TUTORIEL
   `.tutorialModalContinue` is now a JS hook only (profiles.js reads it to close
   the modal and start the connect). It used to carry a fixed 200x50 purple
   button, which fought .tuto-cta on the same element and pinned every CTA to
   200px, clipping the longer ones in verbose languages. The look lives in
   .tuto-cta, which hugs its label. */
.about-modal {
  display: none;
  position: fixed;
  z-index: 45;
  inset: 0;
  overflow: auto;
  /* Same scrim as the "Connecting to..." card (#profiles-connection-waiting-modal). */
  background: var(--overlay);
  backdrop-filter: blur(10px);
}
.about-modal-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 15px;
  height: 90%;
  max-height: 700px;
    width: 95%;
    max-width: 750px;
    box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
    justify-content: flex-start;
    gap: 10px;
  background-color: var(--surface);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
    overflow-y: auto;
}
/* Open/close: the app's one modal motion (system.css, menu.css --motion-pop-*),
   same as Echoes, Series and the dropdowns: the scrim fades, the sheet rises
   from 10px / 0.96. tutorials.js toggles .is-open. */
.about-modal {
  opacity: 0;
  transition: opacity var(--motion-pop-fade) var(--motion-pop-ease);
}
.about-modal.is-open {
  opacity: 1;
}
.about-modal .about-modal-content {
  transform: translate(-50%, -50%) var(--motion-pop-from);
  transform-origin: bottom center;
  transition: transform var(--motion-pop-move) var(--motion-pop-ease);
}
.about-modal.is-open .about-modal-content {
  transform: translate(-50%, -50%);
}
.policy-disclaimer{
  font-size: 9px;
  text-align: center;
  margin-top: 15px;
}

/* ===== Connect guides =====
   One screen per platform: logo + title, then two or three numbered lines on a
   rail, one key word in bold each, an optional grey hint under a line, and the
   edge cases behind one closed "help" line. No boxes, chips or coloured notes:
   the old guide had ten separate blocks on one screen and read as clutter.
   A modal sets --tuto-accent and nothing else changes.
   --tuto-accent is only ever a FILL under white text (the CTA) or a tint. Never
   ink: the platform colours are tuned for their own brand, not our two themes. */
.tuto, .tuto-head, .tuto-step-body { display: flex; flex-direction: column; }

/* Hugs its content and stays narrow: a guide is a short read, not a page.
   NOT justify-content:center: this is a scroll container, and centring an
   overflowing flex column pushes its top out of reach. */
.tuto-modal-content {
  height: auto;
  max-height: 90%;
  max-width: 420px;
  justify-content: flex-start;
  padding: 28px 24px 18px;
}
.tuto {
  align-items: center;
  gap: 22px;
  width: 100%;
  box-sizing: border-box;
}
.tuto-head {
  align-items: center;
  gap: 10px;
  text-align: center;
}
.tuto-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-big);
}
/* Two platforms, two logos, slightly overlapped so they read as one pair. */
.tuto-badges {
  display: flex;
  align-items: center;
}
.tuto-badges .tuto-badge + .tuto-badge {
  margin-left: -14px;
  border: 2px solid var(--surface);
}
.tuto-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  color: var(--font-black);
}

/* The link diagram: an Instagram account sitting UNDER a Facebook Page, next to
   a lone one that cannot connect. Meta's rule in one picture, no words. */
.tuto-link-map {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.tuto-link-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tuto-link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 120px;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background-color: var(--surface);
}
.tuto-link-card img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}
.tuto-link-card i {
  display: block;
  height: 5px;
  border-radius: var(--radius-pill);
  background-color: var(--gray-clear-3);
}
.tuto-link-card i:first-child { width: 48px; }
.tuto-link-card i:last-child { width: 30px; margin-top: 4px; }
.tuto-link-wire {
  width: 2px;
  height: 14px;
  background-color: var(--border-color);
}
.tuto-link-flag {
  position: absolute;
  top: -7px;
  right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  color: #ffffff;
}
.tuto-link-flag svg { width: 11px; height: 11px; }
/* Literal: these carry a white glyph in both themes (7.5:1 and 6.1:1). */
.tuto-link-yes { background-color: #046B4E; }
.tuto-link-no { background-color: #C60404; }
.tuto-link-orphan img,
.tuto-link-orphan span:not(.tuto-link-flag) { opacity: 0.5; }
.tuto-link-empty {
  min-height: 38px;
  border-style: dashed;
  background-color: transparent;
}

/* The rail: numbered discs joined by one thin line, so the steps read as a
   single path instead of separate blocks. */
.tuto-steps {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tuto-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 20px;
}
.tuto-step:last-child { padding-bottom: 0; }
.tuto-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 4px;
  width: 2px;
  border-radius: var(--radius-pill);
  background-color: var(--border-color);
}
.tuto-step-number {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--gray-clear-3);
  color: var(--font-black);
  font-size: 13px;
  font-weight: 500;
}
.tuto-step-body {
  flex: 1;
  min-width: 0;
  gap: 3px;
  padding-top: 4px;
}
.tuto-step-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--font-black-clair);
}
.tuto-step-line b {
  font-weight: 500;
  color: var(--font-black);
}
.tuto-step-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--font-gray-clair);
}
/* The URL is in the template, the locale carries only the label. */
.tuto-step-link {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-ink);
  text-decoration: underline;
}

/* Edge cases ("wrong account?", "page missing?"): one quiet line, closed. */
.tuto-help {
  width: 100%;
  margin-top: -6px;
  font-size: 13px;
  color: var(--font-gray);
}
.tuto-help summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  color: var(--font-gray);
  font-weight: 500;
}
.tuto-help summary::-webkit-details-marker { display: none; }
.tuto-help summary::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--transition-fast) ease;
}
.tuto-help[open] summary::before { transform: rotate(45deg); }
.tuto-help summary:hover { color: var(--font-black); }
.tuto-help p {
  margin: 8px 0 0 12px;
  line-height: 1.45;
}

.tuto-cta {
  height: 44px;
  padding: 0 36px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--tuto-fill, var(--tuto-accent, var(--accent)));
  /* --tuto-cta-ink: for a brand fill that carries dark text (Snapchat yellow). */
  color: var(--tuto-cta-ink, #ffffff);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: filter var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.tuto-cta:hover {
  filter: brightness(1.08);
  transform: var(--lift);
}
.tuto .policy-disclaimer {
  margin: -10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--font-gray-clair);
}
.tuto .policy-disclaimer a {
  color: inherit;
  text-decoration: underline;
}

/* A refused connect, on top of the steps: what went wrong, what to do. */
.tuto-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--red-ink) 35%, transparent);
  border-radius: var(--radius-small);
  background-color: color-mix(in srgb, var(--red-ink) 8%, transparent);
}
.tuto-error[hidden] { display: none; }
.tuto-error .tuto-link-flag {
  position: static;
  flex: 0 0 auto;
  margin-top: 1px;
}
.tuto-error-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tuto-error-reason {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--red-ink);
}
.tuto-error-fix {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--font-black-clair);
}
/* The step that fixes it: its number turns red. */
/* The guide's X sits in the sheet's corner, like the waiting card's. */
.tuto-close {
  z-index: 1;
}
/* Refusal title: orange warning before "We couldn't connect {platform}". */
.tuto-title-warn {
  margin-right: 10px;
  font-size: 18px;
  color: var(--orange-ink);
}
/* "Try again" after a refusal: reload icon before the label. */
.tuto-cta > i {
  margin-right: 8px;
  font-size: 13px;
}
.tuto-step.is-fix .tuto-step-number {
  background: #C60404;
  color: #ffffff;
}

/* Phone: same layout, only tighter. Nothing wraps into a second structure. */
@media (max-width: 600px) {
  .tuto-modal-content {
    max-height: 88%;
    padding: 22px 18px 14px;
  }
  .tuto { gap: 18px; }
  .tuto-badge { width: 40px; height: 40px; }
  .tuto-title { font-size: 18px; }
  .tuto-step { gap: 12px; padding-bottom: 16px; }
  .tuto-step-line { font-size: 14px; }
  .tuto-link-map { gap: 12px; }
  .tuto-link-card { width: 108px; padding: 7px 8px; gap: 6px; }
  .tuto-link-card i:first-child { width: 40px; }
  .tuto-link-card i:last-child { width: 26px; }
}

/* Waiting card shown while the network sign-in popup is open */
#profiles-connection-waiting-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: var(--overlay);
  backdrop-filter: blur(10px);
  z-index: 60;
}
#profiles-connection-waiting-card {
  position: relative;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 24px 22px;
  box-sizing: border-box;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
#profiles-connection-waiting-close,
.tuto-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--height-small);
  height: var(--height-small);
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--font-gray);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--transition-fast) ease, color var(--transition-fast) ease;
}
#profiles-connection-waiting-close:hover,
.tuto-close:hover {
  background: var(--hover-color);
  color: var(--font-black);
}
#profiles-connection-waiting-card > i {
  font-size: 26px;
  color: var(--accent-ui);
}
#profiles-connection-waiting-title {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 500;
}
#profiles-connection-waiting-text {
  margin: 0;
  color: var(--font-gray);
}
/* Help state: the platform's logo in place of the spinner. */
#profiles-connection-waiting-card > [hidden] {
  display: none;
}
#profiles-connection-waiting-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-big);
}
#profiles-connection-waiting-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* "We use secure OAuth connections" under the Connect Profiles title (app:
   connectProfilesModal.js, portal: portal.js openPlatformModal). */
.connect-secure-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 3px 0 0;
  color: var(--font-gray);
  font-size: 12px;
  font-weight: 400;
}
.connect-secure-note svg {
  flex: none;
  width: 13px;
  height: 13px;
}

/* Moved from profiles.css: the brand portal draws the same four forms
   (static/js/profiles/connectForms.js builds them for both). */
/* Telegram, email, Bluesky and WordPress connect modals (a field to fill before, or instead of, the OAuth popup) */
#telegram-connect-modal, #email-connect-modal, #bluesky-connect-modal, #wordpress-connect-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 16, 26, 0.48);
  box-sizing: border-box;
}

#telegram-connect-card, #email-connect-card, #bluesky-connect-card, #wordpress-connect-card {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--font-black);
  box-shadow: 0 18px 48px rgba(10, 16, 26, 0.24);
  text-align: center;
  box-sizing: border-box;
}

#telegram-connect-close, #email-connect-close, #bluesky-connect-close, #wordpress-connect-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--font-gray);
  cursor: pointer;
}

#telegram-connect-close:hover, #email-connect-close:hover, #bluesky-connect-close:hover, #wordpress-connect-close:hover {
  background: var(--hover-color);
  color: var(--font-black);
}

#telegram-connect-platform, #email-connect-platform, #bluesky-connect-platform, #wordpress-connect-platform {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-small);
  background: var(--bg-blue-clear);
}

#telegram-connect-platform img, #email-connect-platform img, #bluesky-connect-platform img, #wordpress-connect-platform img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

#telegram-connect-title, #email-connect-title, #bluesky-connect-title, #wordpress-connect-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--font-black);
}

#telegram-connect-card p, #email-connect-card p, #bluesky-connect-card p, #wordpress-connect-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--font-gray);
}

#telegram-connect-steps {
  width: 100%;
  margin: 0;
  padding: 12px 12px 12px 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--radius-small);
  background: var(--bg-blue-clear);
  text-align: left;
  box-sizing: border-box;
}

#telegram-connect-steps li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--font-black);
}

.telegram-connect-field, .email-connect-field, .bluesky-connect-field, .wordpress-connect-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.telegram-connect-field label, .email-connect-field label, .bluesky-connect-field label, .wordpress-connect-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--font-black);
}

.telegram-connect-field input, .email-connect-field input, .bluesky-connect-field input, .wordpress-connect-field input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--font-black);
  font-size: 14px;
  box-sizing: border-box;
}

.telegram-connect-field input:focus, .email-connect-field input:focus, .bluesky-connect-field input:focus, .wordpress-connect-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.telegram-connect-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--font-black);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.telegram-connect-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#telegram-connect-notice {
  width: 100%;
  margin: 4px 0 2px 0;
  padding: 14px 16px;
  /* The modal card centers its content; this block is prose + a form field. */
  text-align: left;
  border-radius: var(--radius-small);
  background: var(--bg-blue-clear);
  box-sizing: border-box;
}

#telegram-connect-notice h3 {
  margin: 0;
  color: var(--font-black);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

#telegram-connect-notice p {
  margin: 8px 0 0 0;
  color: var(--font-gray);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

#telegram-connect-notice-steps {
  margin: 10px 0 0 0;
  padding-left: 18px;
  color: var(--font-gray);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}

#telegram-connect-notice-steps li {
  margin: 0 0 4px 0;
}

#telegram-connect-notice-create {
  font-weight: 600;
  color: var(--font-black) !important;
}

#telegram-connect-notice .telegram-connect-field {
  margin-top: 14px;
}

#telegram-connect-notice .telegram-connect-field label {
  font-size: 11px;
  line-height: 1.45;
}


#telegram-connect-card #telegram-connect-error, #email-connect-card #email-connect-error, #bluesky-connect-card #bluesky-connect-error, #wordpress-connect-card #wordpress-connect-error {
  width: 100%;
  font-size: 13px;
  color: var(--red-ink);
  text-align: left;
}

#telegram-connect-submit, #email-connect-submit, #bluesky-connect-submit, #wordpress-connect-submit {
  width: auto;
  align-self: flex-end;
  margin-left: auto;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  
  cursor: pointer;
}

#telegram-connect-submit:hover, #email-connect-submit:hover, #bluesky-connect-submit:hover, #wordpress-connect-submit:hover {
  background: var(--accent-hover);
}

#telegram-connect-submit:disabled, #email-connect-submit:disabled, #bluesky-connect-submit:disabled, #wordpress-connect-submit:disabled {
  opacity: 0.6;
  cursor: default;
}


/* WordPress: the modal first asks where the blog lives (two choices), then
   shows the self-hosted form. Titles and buttons stay at 500, the light voice. */
#wordpress-connect-title, #wordpress-connect-submit { font-weight: 500; }
.wordpress-connect-choices { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.wordpress-connect-choice {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--font-black);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast) ease, background-color var(--transition-fast) ease;
}
.wordpress-connect-choice:hover { border-color: var(--accent); background: var(--hover-color); }
.wordpress-connect-choice strong { font-size: 14px; font-weight: 500; }
.wordpress-connect-choice span { font-size: 13px; line-height: 1.45; color: var(--font-gray); }
#wordpress-selfhosted-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
#wordpress-selfhosted-form[hidden], .wordpress-connect-choices[hidden] { display: none; }
.wordpress-connect-field a { font-size: 12px; color: var(--accent-ink, var(--accent)); text-decoration: underline; }
