/**
 * Promotion codes on the signup page. Markup comes from askell/promo-codes.php (banner, field)
 * and askell/promo-codes.js (offers on plan cards, annual buttons, price summary).
 *
 * Boxes with their own background set their own text colour, so they stay readable in the
 * theme's night mode; text that sits directly on a plan card inherits the card's colour.
 */

.askell-promo [hidden],
.askell-promo-banner[hidden] {
  display: none !important;
}

/* --- notice above the plans --- */
.askell-promo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  max-width: 800px;
  margin: 30px auto 0;
  padding: 14px 18px;
  border: 2px solid #77b255;
  border-radius: 12px;
  background: #f3f9ee;
  color: #222;
}
.askell-promo-banner--warning {
  border-color: #f0c040;
  background: #fff8e1;
}
.askell-promo-banner__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: #222;
}

/* --- offer on a plan card --- */
.askell-has-offer h3.card-title span {
  text-decoration: line-through;
  opacity: 0.55;
}
.askell-promo-offer {
  margin: 6px 0 12px;
  text-align: center;
  line-height: 1.35;
}
.askell-promo-offer__tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #77b255;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.askell-promo-offer__price {
  display: block;
  font-size: 18px;
  font-weight: 700;
}
.askell-promo-offer__after {
  display: block;
  font-size: 13px;
  opacity: 0.75;
}

/* --- annual option under a card's main button --- */
.askell-annual {
  margin-top: 12px;
  text-align: center;
}
a.askell-annual__btn {
  display: block;
  padding: 10px 8px;
  border: 3px solid #000;
  border-radius: 12px;
  background: #fff;
  color: #000;
  line-height: 1.35;
  text-decoration: none;
}
a.askell-annual__btn:hover,
a.askell-annual__btn:focus {
  background: #f3f9ee;
  color: #000;
}
a.askell-annual__btn.askell-selected {
  border-color: #77b255;
  background: #f3f9ee;
}
.askell-annual__btn span {
  display: block;
}
.askell-annual__label {
  font-weight: 700;
  text-transform: uppercase;
}
.askell-annual__tag {
  font-size: 13px;
  font-weight: 700;
  color: #4c8a2c;
}
.askell-annual__price {
  font-weight: 700;
}
.askell-annual__after {
  font-size: 13px;
  color: #555;
}

/* --- code field in the signup form --- */
.askell-promo {
  margin: 4px 0 18px;
}
.askell-promo .askell-promo__toggle,
.askell-promo .askell-promo__remove,
.askell-promo .askell-promo__retry,
.askell-promo-banner .askell-promo__remove {
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}
.askell-promo .askell-promo__toggle {
  font-size: 15px;
}
.askell-promo__label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.askell-promo__row {
  display: flex;
  gap: 8px;
}
.askell-promo__row .form-control {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  text-transform: uppercase;
}
.askell-promo__row .form-control::placeholder {
  text-transform: none;
}
.askell-promo .askell-promo__apply {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0 18px;
  border: 2px solid #000;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
.askell-promo__message {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
}
.askell-promo__message:empty {
  display: none;
}
.askell-promo__message--error {
  color: #b02a37;
}

/* --- price summary above the submit button --- */
.askell-promo-summary {
  padding: 14px 16px;
  border: 2px solid #77b255;
  border-radius: 12px;
  background: #f3f9ee;
  color: #222;
  text-align: left;
}
.askell-promo-summary--warning {
  border-color: #f0c040;
  background: #fff8e1;
}
.askell-promo-summary__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.askell-promo-summary__head:empty {
  display: none;
}
.askell-promo-summary__title {
  font-weight: 700;
  color: #222;
}
.askell-promo-summary p {
  margin: 6px 0 0;
  line-height: 1.4;
  color: #222;
}
.askell-promo-summary p:first-child {
  margin-top: 0;
}
.askell-promo-summary p.askell-promo-summary__price {
  font-size: 18px;
  font-weight: 700;
}
.askell-promo-summary p.askell-promo-summary__now {
  font-weight: 600;
}
.askell-promo-summary .askell-promo__remove,
.askell-promo-summary .askell-promo__retry {
  color: #222;
}
.askell-promo-summary .askell-promo__retry {
  margin-top: 8px;
}

/* --- a code whose offer is on the yearly plan only ("12 fyrir 9"): the yearly offer is the
   card's one button. (promo-codes.js puts the card's own button - the month at the ordinary
   price - away while such a code is active.) --- */
.askell-annual-first .askell-annual {
  margin: 0;
}
/* the heading's price is the month's; with only the year on offer it is left out */
.askell-annual-first h3.card-title span {
  display: none;
}
.askell-annual-first a.askell-annual__btn {
  padding: 14px 8px;
  border-color: #000;
  background: #000;
  color: #fff;
}
.askell-annual-first a.askell-annual__btn:hover,
.askell-annual-first a.askell-annual__btn:focus {
  background: #222;
  color: #fff;
}
.askell-annual-first a.askell-annual__btn.askell-selected {
  border-color: #70a353;
  background: #77b255;
  color: #fff;
}
.askell-annual-first .askell-annual__label {
  font-size: 17px;
}
.askell-annual-first .askell-annual__tag {
  color: #b9e39f;
}
.askell-annual-first .askell-selected .askell-annual__tag,
.askell-annual-first .askell-annual__after,
.askell-annual-first .askell-selected .askell-annual__after {
  color: #fff;
}
.askell-annual-first .askell-annual__after {
  opacity: 0.85;
}
@supports (grid-template-rows: subgrid) {
  /* the cards' shared rows (askell/signup.css): the yearly block takes the button's row */
  #plans-section .each-tier.askell-annual-first .card-body > .askell-annual { grid-row: 6; }
  /* a card without a yearly block shares that row: its button keeps its own height */
  #plans-section .each-tier .card-body > .d-grid { align-self: start; }
}

/* --- in the form: one press from the monthly plan to the yearly plan the code is for --- */
.askell-promo .askell-promo__switch {
  display: block;
  float: none;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 10px 0 8px;
  padding: 12px 16px;
  border: 2px solid #000;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3 !important;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
