/*
 * accounts.crossmap.com stylesheet.
 *
 * ONE sheet for all widths. The legacy shipped two full stylesheets --
 * public/css/desktop.css (190KB) and mobile.css (181KB) -- selected by sniffing
 * the user agent server-side and rendering one of two parallel view trees. The
 * two sheets styled the SAME class names differently, which is what media
 * queries are for.
 *
 * Values here are lifted from the legacy desktop.css so the pages look like
 * they did: the box geometry, the Crossmap red (#F01313), Roboto headings and
 * the card shadow are all the originals. What is gone is the ~370KB of rules
 * for a site-wide nav, search overlay, article grid and IE9 fallbacks that
 * these nine pages never used.
 */

:root {
  --color-primary: #f01313;
  --color-primary-dark: #a70000;
  --color-text: #1a1a1a;
  --color-quiet: #6b7280;
  --color-border: #d7d7db;
  --color-bg: #f2f2f4;
  --color-surface: #fff;
  --color-error: #c0261c;
  --color-success: #107c41;
  --radius: 0.625rem;
  /* One source of truth for the content column; the header bar uses it too. */
  --page-width: 60rem;
  --shadow-card: 0 0.4375rem 1.25rem rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Helvetica, Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

/* -- header / footer ------------------------------------------------------- */

/*
 * Two header treatments, deliberately.
 *
 * Signed OUT (.sso-header): just the logo, centred above the card. The page is
 * a single focused task and a nav bar would be furniture.
 *
 * Signed IN (.app-header): a real bar, because there is now an identity and a
 * way out, and those belong together. Its contents are bounded to the same
 * width as the page below -- the first version pinned "Sign out" to the
 * viewport corner with position:absolute, which on a wide monitor left it
 * stranded an inch from the screen edge and a foot from anything it related to.
 */
.sso-header {
  margin-bottom: 1.5rem;
  padding: 1.75rem 1rem 0;
  text-align: center;
}

.sso-header .logo,
.app-header .logo {
  width: 8.125rem;
  height: auto;
  display: block;
}

.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.75rem;
}

.app-header-inner {
  width: var(--page-width);
  max-width: 92%;
  margin: 0 auto;
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Avatar + name + sign out, grouped so the action reads as belonging to the user. */
.app-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.app-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

.app-user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg);
  flex: none;
}

/*
 * Quiet, not red. It was inheriting the primary colour and underline, which
 * made the single most destructive control on the page the loudest thing in
 * the header.
 */
.app-signout {
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--color-quiet);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}

.app-signout:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.sso-footer {
  padding: 2rem 1rem;
  text-align: center;
}

/* -- the card ------------------------------------------------------------- */

.sso-box {
  width: 26.25rem;
  max-width: 90%;
  margin: 1.25rem auto 2.5rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--color-surface);
}

/* -- typography ----------------------------------------------------------- */

.hd2,
.hd3 {
  font-family: Roboto, Helvetica, Arial, sans-serif;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.hd2 { font-size: 1.25rem; }
.hd3 { font-size: 1.0625rem; }

.fz13 { font-size: 0.8125rem; }
.fz14 { font-size: 0.875rem; }

.quiet { color: var(--color-quiet); }
.center-align { text-align: center; }
.upper { text-transform: uppercase; }
.tdu { text-decoration: underline; }

a { color: inherit; }
.link-color,
a.link { color: var(--color-primary); transition: color 0.18s; }
.link-color:hover,
a.link:hover { color: var(--color-primary-dark); }

.sso-des { color: var(--color-quiet); }

/* -- spacing utilities (the legacy vocabulary, kept) ---------------------- */

.spacing-b-sm { margin-bottom: 0.5rem; }
.spacing-b-md { margin-bottom: 1rem; }
.spacing-b-re { margin-bottom: 1.25rem; }
.spacing-t-sm { margin-top: 0.5rem; }
.spacing-t-lg { margin-top: 1.5rem; }

/* -- forms ---------------------------------------------------------------- */

.no-bullet {
  list-style: none;
  margin: 0;
  padding: 0;
}

.form-ul > li + li { margin-top: 0.875rem; }

.l-justify {
  display: flex;
  justify-content: flex-end;
}

label { display: block; margin-bottom: 0.25rem; }

input[type="text"],
input[type="email"],
input[type="password"] {
  font: inherit;
  color: inherit;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: #fff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

input:disabled {
  background: var(--color-bg);
  color: var(--color-quiet);
}

.input-block {
  display: block;
  width: 100%;
}

.button {
  display: inline-block;
  font: inherit;
  font-size: 0.875rem;
  text-align: center;
  text-decoration: none;
  padding: 0 0.625rem;
  height: 2.5rem;
  line-height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
}

.button.lg {
  height: 2.875rem;
  line-height: 2.875rem;
  font-size: 0.9375rem;
}

.button.primary {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.button.primary:hover { background: var(--color-primary-dark); }
.button:disabled { opacity: 0.6; cursor: default; }

/* Two stacked buttons on the consent screen. */
.sso-box form + form { margin-top: 0.5rem; }

/* -- messages ------------------------------------------------------------- */

.messages { margin-bottom: 0.75rem; }

.message-error,
.message-success {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
}

.message-error {
  color: var(--color-error);
  background: #fdeceb;
}

.message-success {
  color: var(--color-success);
  background: #e9f6ee;
}

/* -- profile -------------------------------------------------------------- */

.profile-layout {
  width: var(--page-width);
  max-width: 92%;
  margin: 0 auto 3rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 15rem 1fr;
  align-items: start;
}

.profile-nav {
  padding: 0.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--color-surface);
}

.profile-nav a {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.profile-nav a:hover {
  background: var(--color-bg);
}

/*
 * Mark where you are. Without it the four items were indistinguishable and the
 * nav told you nothing about the page you were already on.
 */
.profile-nav a[aria-current="page"] {
  background: var(--color-bg);
  color: var(--color-primary);
  font-weight: 500;
}

.profile-panel {
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--color-surface);
}

/* A rule under the page title, so the heading reads as a header. */
.profile-panel > h1 {
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg);
  flex: none;
}

/*
 * Two columns on a wide panel: the labels were stacked above their values in a
 * tall ragged list with acres of space beside it.
 */
.profile-fields {
  margin: 0;
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
}

.profile-fields dt { margin: 0; }
.profile-fields dd { margin: 0; }

/* A divider above the actions, so the button is clearly a page action. */
.profile-actions {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.badge {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-quiet);
}

.consent-scopes li {
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--color-border);
}

/*
 * Accessible label hiding. The sign-in and sign-up forms use placeholders for
 * the visual design, and a placeholder is not a label -- screen readers need
 * the real thing.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* -- explore + site footer ------------------------------------------------ */
/*
 * Ported from the legacy desktop.css. The geometry, the radii and the five
 * section colours (#F01313 blogs, #0D6DFD news, black videos, #8742F5
 * podcasts, #FD7E17 books) are the originals, so these read as the same
 * components they always were.
 */

.explore-row {
  flex: none;
  width: var(--page-width);
  max-width: 92%;
  margin: 0 auto 2rem;
  padding: 1.5rem 1.875rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-radius: var(--radius);
  background: #fafafa;
}

.explore-title {
  margin: 0;
  font-family: Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.explore-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9375rem;
}

.section-button {
  display: block;
  min-width: 5.25rem;
  padding: 1.25rem 1rem 1rem;
  border-radius: 0.75rem;
  background: var(--color-surface);
  text-align: center;
  transition: box-shadow 0.18s, transform 0.18s;
}

.section-button:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.section-button svg {
  width: 1.75rem;
  height: 1.75rem;
  vertical-align: bottom;
}

.section-button .txt {
  display: block;
  margin-top: 0.625rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
}

/*
 * Links in these two components are not underlined. The base sheet leaves the
 * browser default in place (which the rest of the pages want), so it is turned
 * off HERE rather than globally -- an Explore tile and a footer link are
 * buttons and navigation, and the underline made the row look like a list of
 * visited links.
 */
.section-button,
.footer-links a,
.site-footer-logo { text-decoration: none; }

.section-button.blogs { color: #f01313; }
.section-button.news { color: #0d6dfd; }
.section-button.podcasts { color: #8742f5; }
.section-button.books { color: #fd7e17; }
.section-button.bible { color: #0d9488; }
/* videos has no colour of its own in the legacy -- it inherits the text black. */

.site-footer {
  flex: none;
  padding: 1.875rem 0;
  background: #fafafa;
}

/*
 * Two columns at desk width: identity and links on the left, social on the
 * right, which is where the legacy put them. A grid rather than a float so the
 * social row can stay put while the link list wraps underneath it.
 */
.site-footer-inner {
  width: var(--page-width);
  max-width: 92%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.75rem 1.5rem;
}

.site-footer-logo {
  display: block;
  grid-column: 1;
}

.site-footer-logo img {
  display: block;
  width: 7.1875rem;
  height: auto;
}

.footer-social {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  display: flex;
  gap: 0.625rem;
}

.footer-links {
  grid-column: 1;
  line-height: 1.2;
  font-size: 0.9375rem;
  color: #555;
}

.footer-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 1.5em;
}

.footer-links a {
  display: block;
  padding: 0.2em 0;
  transition: color 0.18s;
}

.footer-links a:hover { color: var(--color-primary); }

.footer-copyright {
  grid-column: 1;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-quiet);
}

.icon-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #fff;
  background: #0b0b0b;
  transition: background 0.25s;
}

/* The legacy's per-network hover colours, which only ever appeared on hover. */
.icon-round.facebook:hover { background: #1877f2; }
.icon-round.twitter:hover { background: #000; }  /* X, not the old Twitter blue */
.icon-round.instagram:hover { background: #f00073; }
.icon-round.linkedin:hover { background: #2867b2; }
.icon-round.pinterest:hover { background: #e60023; }
.icon-round.youtube:hover { background: red; }
.icon-round.email:hover { background: #1d90dd; }

/* -- narrow screens ------------------------------------------------------- */
/*
 * This replaces the entire separate mobile.css and the user-agent sniffing
 * that chose it. The card already sizes itself with max-width: 90%; what
 * genuinely differs is the profile side-nav, which stacks.
 */
@media (max-width: 48rem) {
  .profile-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 0 1rem;
    gap: 1rem;
  }

  /* The side nav becomes a horizontal row of pills above the panel. */
  .profile-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .profile-nav a {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .profile-panel { padding: 1.25rem; }

  /* Labels above values once there is no room for two columns. */
  .profile-fields { grid-template-columns: 1fr; gap: 0.25rem; }
  .profile-fields dt:not(:first-child) { margin-top: 0.75rem; }

  .app-header-inner { max-width: 100%; padding: 0 1rem; }
  .app-user-name { display: none; }

  .sso-box {
    margin-top: 0.5rem;
    padding: 1.25rem;
  }

  .profile-identity { gap: 1rem; }

  /* The heading sits above the row once five cards no longer fit beside it. */
  .explore-row {
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
    margin: 0 1rem 1.5rem;
    padding: 1.25rem;
    gap: 1rem;
  }

  .explore-list { gap: 0.625rem; }

  .section-button { min-width: 4.5rem; padding: 1rem 0.75rem 0.75rem; }

  /* Social drops below rather than squeezing the links into one word a line. */
  .site-footer-inner {
    max-width: 100%;
    padding: 0 1rem;
    grid-template-columns: 1fr;
  }

  .footer-social {
    grid-column: 1;
    grid-row: auto;
    order: 4;
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
