/*
 * Public pricing section (resources/views/home/sections/pricing.blade.php).
 *
 * Deliberately self-contained: no framework classes are used in the markup, so
 * everything the section needs is in this file. Every selector is namespaced
 * under .pricing to keep it from leaking into the rest of the landing page or
 * into the AdminLTE dashboard, which loads a different stylesheet on the same
 * origin.
 *
 * The palette reuses the variables declared in admin_custom.css (--primary,
 * --second, --dark) with hard-coded fallbacks, so the section still renders
 * correctly if it is ever used on a page that does not load that file.
 */

.pricing {
  background: #ffffff;
  padding: 5rem 1.5rem;
  font-family: 'Outfit', 'Roboto', sans-serif;
}

/* ---------- Heading ---------- */

.pricing-head {
  max-width: 640px;
  margin: 0 auto 3.5rem;
  text-align: center;
}

.pricing-eyebrow {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--primary, #205ea3);
  border-radius: 999px;
  color: var(--primary, #205ea3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* clamp() so the heading shrinks on a phone instead of forcing the page wide. */
.pricing-title {
  margin: 0 0 0.75rem;
  color: var(--dark, #121621);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.pricing-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ---------- Grid ---------- */

/*
 * auto-fit rather than a fixed three columns: the number of plans is whatever
 * is active in the database, so the row has to stay balanced at two, three or
 * four cards without anyone editing this file.
 */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.75rem;
  align-items: stretch;
  max-width: 1140px;
  margin: 0 auto;
}

/* ---------- Card ---------- */

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2.25rem 1.75rem;
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(18, 22, 33, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary, #205ea3);
  box-shadow: 0 20px 40px rgba(32, 94, 163, 0.1);
}

.pricing-card--featured {
  border-color: var(--second, #57a773);
  box-shadow: 0 12px 32px rgba(87, 167, 115, 0.16);
}

.pricing-card--featured:hover {
  border-color: var(--second, #57a773);
  box-shadow: 0 24px 48px rgba(87, 167, 115, 0.22);
}

.pricing-ribbon {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.95rem;
  background: var(--second, #57a773);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pricing-name {
  margin: 0 0 0.4rem;
  color: var(--dark, #121621);
  font-size: 1.35rem;
  font-weight: 700;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.pricing-amount {
  color: var(--dark, #121621);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
}

.pricing-period {
  color: #6b7280;
  font-size: 0.95rem;
}

.pricing-desc {
  margin: 0 0 1.25rem;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---------- Feature list ---------- */

.pricing-features {
  flex: 1 1 auto;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
  color: #374151;
  font-size: 0.92rem;
  line-height: 1.5;
}

.pricing-feature strong {
  color: var(--dark, #121621);
  font-weight: 600;
}

/* A feature the plan does not include stays on the list, greyed out, so the
   tiers can be compared row by row instead of by counting bullets. */
.pricing-feature--off,
.pricing-feature--off strong {
  color: #9ca3af;
}

/*
 * The tick and cross are drawn in CSS rather than pulled from an icon font:
 * the section must not depend on anything it does not ship with.
 */
.pricing-mark {
  position: relative;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  border-radius: 50%;
}

.pricing-mark--yes {
  background: rgba(87, 167, 115, 0.14);
}

.pricing-mark--yes::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 9px;
  border: solid var(--second-dark, #157145);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pricing-mark--no {
  background: #f1f3f5;
}

.pricing-mark--no::before,
.pricing-mark--no::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 5px;
  width: 10px;
  height: 2px;
  background: #9ca3af;
}

.pricing-mark--no::before {
  transform: rotate(45deg);
}

.pricing-mark--no::after {
  transform: rotate(-45deg);
}

/* ---------- Call to action ---------- */

.pricing-cta {
  display: block;
  margin-top: auto;
  padding: 0.8rem 1rem;
  border: 1px solid var(--primary, #205ea3);
  border-radius: 12px;
  background: transparent;
  color: var(--primary, #205ea3);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.pricing-cta:hover,
.pricing-cta:focus {
  background: var(--primary, #205ea3);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
}

.pricing-cta--solid {
  border-color: var(--second, #57a773);
  background: var(--second, #57a773);
  color: #ffffff;
}

.pricing-cta--solid:hover,
.pricing-cta--solid:focus {
  background: var(--second-dark, #157145);
  border-color: var(--second-dark, #157145);
  color: #ffffff;
}

.pricing-cta:focus-visible {
  outline: 2px solid var(--primary, #205ea3);
  outline-offset: 3px;
}

/* ---------- Footnote ---------- */

/* Prices are yearly while the request limits are monthly, which is easy to
   misread with the two numbers sitting on the same card. This says it. */
.pricing-note {
  max-width: 1140px;
  margin: 2rem auto 0;
  color: #6b7280;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Small screens ---------- */

/*
 * Three plans are either three across or one down. Left on auto-fit, the tablet
 * range resolves to two columns and leaves the third plan alone on its own row,
 * which reads as though it were a different kind of thing. Above this width
 * auto-fit still applies, so a fourth plan added from /admin/plans lays itself
 * out without anyone editing this file.
 */
@media (max-width: 991.98px) {
  .pricing-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .pricing {
    padding: 3.5rem 1rem;
  }

  .pricing-card {
    padding: 2rem 1.35rem;
  }

  .pricing-amount {
    font-size: 2.2rem;
  }

  /* No hover to undo on a touch screen: a tap would leave the card stuck in
     its raised state. */
  .pricing-card:hover {
    transform: none;
  }
}
