/* Email updates: the subscription form (/subscribe and every website's footer: partials/subscribe-form.blade.php), the
   thank-you note and the confirmation and unsubscribe pages (SubscribeController). Uses the website's own tokens
   (assets/css/style.css, extra/brand.css). Prefix sb-. */

/* ---------------------------------------------------------------- the form, everywhere */
.sb-form { margin: 0; }
.sb-title { margin: 0 0 .5rem; font-size: 1.4rem; line-height: 1.25; }
.sb-fields { display: grid; gap: 0 1rem; }
.sb-field { margin-bottom: .9rem; }
.sb-field label { display: inline-flex; gap: .25rem; }
.sb-req { color: var(--danger); }
.sb-err { margin: 0; font-size: .87rem; font-weight: 600; color: var(--danger); }
.sb-err:empty { display: none; }
.sb-field.has-error input { border-color: var(--danger); }
.sb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.sb-alert { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: var(--radius-sm); border-left: 4px solid var(--danger); background: #fdecee; color: #8a1c2b; font-weight: 600; font-size: .92rem; }
.sb-alert[hidden] { display: none; }
.sb-consent { margin: .25rem 0 0; font-size: .84rem; line-height: 1.55; color: var(--muted); }
.sb-consent a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sb-submit { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; }
.sb-submit[aria-busy="true"] { opacity: .75; cursor: progress; }
.sb-submit[aria-busy="true"] .bi { animation: sb-spin 1s linear infinite; }
@keyframes sb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sb-submit[aria-busy="true"] .bi { animation: none; } }

/* ---------------------------------------------------------------- /subscribe */
.sb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; align-items: start; }
@media (max-width: 960px) { .sb-layout { grid-template-columns: 1fr; } }
.sb-main { min-width: 0; }
.sb-side { display: grid; gap: 1rem; }
.sb-card { padding: 1.75rem; border-radius: var(--radius-lg); background: var(--surface); }
.sb-form--page .sb-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sb-form--page .sb-submit { grid-column: 1 / -1; justify-self: start; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (max-width: 620px) { .sb-card { padding: 1.25rem; } .sb-form--page .sb-fields { grid-template-columns: 1fr; } .sb-form--page .sb-submit { width: 100%; } }
.sb-list { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .55rem; }
.sb-list li { display: flex; gap: .6rem; align-items: flex-start; line-height: 1.45; }
.sb-list .bi { color: var(--blue-600); margin-top: .1rem; }
.sb-steps { margin: .25rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.sb-done { display: flex; gap: 1rem; align-items: flex-start; padding: 1.75rem; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--success); box-shadow: var(--shadow-sm); }
.sb-done > .bi { font-size: 2rem; color: var(--success); line-height: 1; }
.sb-done p { margin: 0 0 .5rem; }
.sb-done p:last-child { margin-bottom: 0; color: var(--ink-2); font-size: .95rem; }
.sb-done:focus { outline: 3px solid var(--blue-100); outline-offset: 3px; }

/* ---------------------------------------------------------------- the confirmation and unsubscribe pages */
.sb-narrow { max-width: 640px; margin: 0 auto; text-align: center; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.sb-narrow p { margin: 0 0 1rem; }
.sb-big { display: block; font-size: 2.6rem; color: var(--blue-600); margin-bottom: .5rem; line-height: 1; }
.sb-big.sb-ok { color: var(--success); }
.sb-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6rem; margin: 0 0 1rem; }
.sb-actions .sb-small { width: 100%; margin: 0; }
.sb-small { font-size: .88rem; color: var(--muted); }
[data-sb-focus]:focus { outline: none; }
.sb-actions button[aria-busy="true"] { opacity: .75; cursor: progress; }

/* ---------------------------------------------------------------- the footer band (dark background) */
.footer-subscribe { margin-top: 1.8rem; padding: 1.25rem 1.5rem; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); }
.sb-form--footer { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr); gap: .5rem 2rem; align-items: start; }
.sb-form--footer .sb-intro { grid-row: span 3; }
.sb-form--footer .sb-title { color: #fff; font-family: var(--font-sans); font-weight: 800; font-size: 1.2rem; margin-bottom: .3rem; }
.sb-form--footer .sb-intro p { margin: 0; color: rgba(255, 255, 255, .82); font-size: .9rem; line-height: 1.5; }
.sb-form--footer .sb-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: end; }
.sb-form--footer .sb-field { margin-bottom: .4rem; }
.sb-form--footer .sb-field label { color: #fff; font-size: .82rem; font-weight: 700; }
.sb-form--footer .sb-req { color: #ffb4bd; }
.sb-form--footer .sb-field input { min-height: 44px; padding: .6rem .8rem; border-color: rgba(255, 255, 255, .35); }
.sb-form--footer .sb-field input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(125, 211, 252, .45); }
.sb-form--footer .sb-submit { min-height: 44px; margin-bottom: .4rem; white-space: nowrap; background: #fff; border-color: #fff; color: var(--navy); }
.sb-form--footer .sb-submit:hover { background: var(--sky); border-color: var(--sky); color: var(--navy); }
.sb-form--footer .sb-submit:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.sb-form--footer .sb-err { color: #ffc9cf; }
.sb-form--footer .sb-field.has-error input { border-color: #ff8a98; box-shadow: 0 0 0 2px rgba(255, 138, 152, .35); }
.sb-form--footer .sb-alert { grid-column: 2; margin: 0 0 .25rem; background: rgba(255, 255, 255, .95); }
.sb-form--footer .sb-consent { grid-column: 2; color: rgba(255, 255, 255, .78); font-size: .8rem; }
.sb-form--footer .sb-consent a { color: #fff; }
.footer-subscribe .sb-done { background: rgba(255, 255, 255, .97); border-color: transparent; color: var(--ink); }
.footer-subscribe .sb-done .sb-title { color: var(--navy); font-size: 1.15rem; }
@media (max-width: 900px) {
  .sb-form--footer { grid-template-columns: 1fr; }
  .sb-form--footer .sb-intro { grid-row: auto; }
  .sb-form--footer .sb-alert, .sb-form--footer .sb-consent { grid-column: 1; }
}
@media (max-width: 620px) {
  .footer-subscribe { padding: 1.1rem; border-radius: 18px; }
  .sb-form--footer .sb-fields { grid-template-columns: 1fr; }
  .sb-form--footer .sb-submit { width: 100%; }
}
