/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  max-width: 42rem;
  margin: 2rem auto;
  padding: 0 1rem;
  color: #1f2328;
  background: #f3f6fb;
}

footer {
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* Forms (2026-10-28). A field inside its label drops to its own line under the label text. */
main input[type="text"],
main input[type="email"],
main input[type="password"],
main select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #c7d2e3;
  border-radius: 8px;
}

main input[type="text"]:focus,
main input[type="email"]:focus,
main input[type="password"]:focus,
main select:focus {
  outline: none;
  border-color: #3570d6;
  box-shadow: 0 0 0 3px rgba(53, 112, 214, 0.2);
}

/* Buttons. The outlined ones use the same pill shape and border as .card-button on the home page. */
.button-primary,
.button-secondary,
.button-danger {
  display: inline-block;
  box-sizing: border-box;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  border: 1px solid #3570d6;
  background: #3570d6;
  color: #fff;
}

.button-primary:hover {
  border-color: #2a5bb0;
  background: #2a5bb0;
}

.button-secondary {
  border: 1px solid #747775;
  background: transparent;
  color: #0b57d0;
}

.button-secondary:hover {
  background: #eaf1fb;
}

.button-danger {
  border: 1px solid #c9a29f;
  background: transparent;
  color: #a8322b;
}

.button-danger:hover {
  background: #fbeceb;
}

.button-primary:focus-visible,
.button-secondary:focus-visible,
.button-danger:focus-visible {
  outline: 3px solid rgba(53, 112, 214, 0.35);
  outline-offset: 2px;
}

.button-primary:disabled,
.button-secondary:disabled,
.button-danger:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Smaller buttons inside table rows (Remove on /team, Mark resolved on /admin). */
td .button-primary,
td .button-secondary,
td .button-danger {
  padding: 0.25rem 0.8rem;
  font-size: 0.875rem;
}

a {
  color: #1a5fd6;
}

/* Home page. The other pages keep the narrow reading column above. */
body:has(main.home) {
  max-width: 62rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
}

.site-header nav a {
  font-weight: 500;
  font-size: 1rem;
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.site-header a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: inherit;
  text-decoration: none;
}

.site-header img {
  border-radius: 9px;
}

.hero {
  display: grid;
  gap: 2rem;
  align-items: start;
  margin: 2.5rem 0 3rem;
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.subhead {
  font-size: 1.2rem;
  color: #3d444d;
  margin: 0 0 1.5rem;
}

.install {
  display: inline-block;
  margin: 0;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
}

a.install {
  background: #1a5fd6;
  color: #fff;
  text-decoration: none;
}

p.install,
span.install {
  border: 1px dashed #8c959f;
  color: #3d444d;
}

/* The install button inside a step of the Pipedrive install page: on its own line under the step text. */
li > .install {
  display: table;
  margin-top: 0.5rem;
}

.hero-note {
  color: #59636e;
  font-size: 0.95rem;
}

@media (min-width: 52rem) {
  .hero {
    grid-template-columns: 1fr 20rem;
    gap: 3rem;
    align-items: start;
  }

  .hero h1 {
    font-size: 2.9rem;
  }
}

/* The example sidebar card, drawn after Gmail's add-on card layout. */
.card {
  margin: 0;
  width: 100%;
  max-width: 20rem;
  justify-self: center;
}

.card-panel {
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 35, 40, 0.08);
  overflow: hidden;
  font-size: 0.875rem;
  color: #1f1f1f;
}

.card-panel p {
  margin: 0;
}

.card-app {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #dadce0;
  font-weight: 500;
  color: #444746;
}

.card-app img {
  border-radius: 5px;
}

.card-header {
  padding: 0.9rem 1rem 0.6rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 500;
}

.card-subtitle {
  color: #5f6368;
}

.card-panel section {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e8eaed;
}

.card-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #5f6368;
}

.card-panel dl {
  margin: 0;
}

.card-panel dl div {
  margin-bottom: 0.5rem;
}

.card-panel dt {
  font-size: 0.75rem;
  color: #5f6368;
}

.card-panel dd {
  margin: 0;
}

.card-panel .card-deal {
  margin-bottom: 0.5rem;
}

/* The divider between deals, like Gmail's divider widget. */
.card-panel hr {
  border: 0;
  border-top: 1px solid #e8eaed;
  margin: 0.5rem 0;
}

.card-deal span {
  display: block;
  font-size: 0.75rem;
  color: #5f6368;
}

/* A row with a button on its right, like Gmail's decoratedText with a button. */
.card-panel .card-row {
  position: relative;
  padding-right: 4.5rem;
}

.card-row .card-button {
  position: absolute;
  right: 0;
  top: 0;
  margin: 0;
  display: inline-block;
  color: #0b57d0;
  font-size: 0.8rem;
}

.card-button {
  display: inline-block;
  margin: 0.25rem 0.25rem 0 0;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #747775;
  background: transparent;
  color: #0b57d0;
  font-weight: 500;
  font-size: 0.8rem;
}

.card figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #59636e;
  text-align: center;
}

.points {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  display: grid;
  gap: 1rem;
}

.points li {
  padding: 1.1rem 1.2rem;
  border: 1px solid #d1d9e0;
  border-radius: 10px;
  background: #fff;
}

.points strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

@media (min-width: 52rem) {
  .points {
    grid-template-columns: repeat(2, 1fr);
  }
}

#pricing,
#faq,
.contact {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

#pricing {
  padding: 1.2rem 1.4rem;
  border-radius: 10px;
  border: 1px solid #d1d9e0;
  background: #fff;
}

#pricing h2 {
  margin-top: 0;
}

#faq h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.3rem;
}

#faq p {
  margin-top: 0;
}

.contact {
  font-size: 1.05rem;
}

.nowrap {
  white-space: nowrap;
}

/* Plan choice before Stripe Checkout (/billing/checkout). */
.plans {
  list-style: none;
  padding: 0;
}

.plans li {
  margin: 0 0 0.75rem;
}

a.plan {
  display: block;
  padding: 0.8rem 1rem;
  border: 1px solid #c7d2e3;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
}

/* Manage team page (/team). */
table.team {
  width: 100%;
  border-collapse: collapse;
}

table.team td {
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid #d8dee8;
  overflow-wrap: anywhere;
}

table.team form {
  margin: 0;
}

main label {
  display: block;
  margin: 0.5rem 0;
}

.notice {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #e6f4ea;
}

.error {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #fdecea;
}

/* Owner's admin page (/admin): plain text tables scroll sideways on a phone. */
pre.funnel,
pre.funnel-daily {
  overflow-x: auto;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: #f4f6fa;
  font-size: 0.85rem;
}

/* Admin sign-in page (2026-10-27): the Sign out button at the top right of /admin. */
form.admin-sign-out {
  float: right;
  margin-top: 1.2rem;
}

/* QA 2026-10-27 evening item 26: a page wide enough for the per-day table (about 100 characters). */
body:has(main.admin) {
  max-width: 70rem;
}

/* On a narrower screen the per-day table scrolls inside this box: the scrollbar always shows, and a shadow on the
   right edge says there is more. The shadow stays at the box's edge (scroll); a cover in the box's colour sits at the
   end of the table (local) and hides it once the table is scrolled to its end. */
.scroll-x {
  overflow-x: scroll;
  border-radius: 8px;
  background:
    linear-gradient(to right, rgba(244, 246, 250, 0), #f4f6fa 60%) 100% 0 / 3rem 100% no-repeat local,
    linear-gradient(to right, rgba(31, 35, 40, 0), rgba(31, 35, 40, 0.18)) 100% 0 / 1.5rem 100% no-repeat scroll,
    #f4f6fa;
  scrollbar-color: #9aa4b2 transparent;
}

.scroll-x::-webkit-scrollbar {
  height: 10px;
}

.scroll-x::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #9aa4b2;
}

.scroll-x pre.funnel-daily {
  overflow-x: visible;
  width: max-content;
  margin: 0;
  background: transparent;
}

/* Wide enough for the table: the long key line under it wraps instead of scrolling. */
@media (min-width: 72rem) {
  .scroll-x pre.funnel-daily {
    width: auto;
    white-space: pre-wrap;
  }
}

.qa-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

/* The subscription id field takes its own row, with its button under it. */
.qa-actions label {
  flex-basis: 100%;
  margin: 0;
}

/* Error tracking (2026-10-27): the Errors table on /admin, in the box that scrolls sideways on a phone. */
.scroll-x table.errors {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.errors td,
table.errors th {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #d8dee8;
  text-align: left;
  vertical-align: top;
}

table.errors form {
  margin: 0;
}
