/* Shared application components. Page stylesheets should describe only the
   layout or content unique to that page. */

.app-standard-hero {
  width: 100%;
  box-sizing: border-box;
  margin-right: 0;
  margin-left: 0;
}

.app-standard-hero h1 {
  margin: 0;
  color: var(--rw-text-strong);
  font-size: clamp(2rem, 5.6vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.app-standard-hero > p:last-child {
  max-width: 680px;
  margin: 0.65rem 0 0;
  color: var(--rw-muted);
  font-size: clamp(0.94rem, 2vw, 1rem);
  font-weight: 400;
  line-height: 1.58;
}

html:is(.browser-mode, .pwa-mode) .app-theme .app-standard-hero {
  border: 0 !important;
}

.app-back-link {
  display: inline-flex;
  margin-bottom: 1.5rem;
  color: var(--rw-muted, var(--muted));
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.app-back-link:focus-visible {
  outline: 2px solid rgba(240, 122, 45, 0.68);
  outline-offset: 3px;
}

/* Layered walnut artwork shared by dashboard and recommendation surfaces. */
.horse-ribbon-surface {
  --horse-ribbon-shift-x: 0%;
  --horse-ribbon-shift-y: -3%;
  --horse-ribbon-rotation: -2deg;
  --horse-ribbon-scale-x: 1.08;
  --horse-ribbon-shift-x-alt: -2%;
  --horse-ribbon-shift-y-alt: 4%;
  --horse-ribbon-rotation-alt: 2deg;
  --horse-ribbon-primary: rgba(82, 51, 36, 0.18);
  --horse-ribbon-secondary: rgba(55, 39, 31, 0.16);
  --horse-ribbon-highlight: rgba(119, 79, 52, 0.16);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.horse-ribbon-surface::before,
.horse-ribbon-surface::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.horse-ribbon-surface::before {
  inset: -24% -12%;
  background: linear-gradient(
    104deg,
    var(--horse-ribbon-secondary),
    var(--horse-ribbon-primary) 45%,
    var(--horse-ribbon-highlight) 76%,
    rgba(67, 47, 36, 0.12)
  );
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath fill='black' fill-opacity='.34' d='M-30 70C75 4 140 142 232 64C322-12 400 135 485 48C544-12 586 22 630 44L630 91C574 62 540 38 484 101C394 191 324 42 236 124C143 210 72 63-30 128Z'/%3E%3Cpath fill='black' fill-opacity='.74' d='M-24 139C58 32 128 220 222 106C311-3 376 193 463 87C520 18 573 43 624 75L624 151C558 113 521 84 464 159C378 263 315 58 231 169C145 283 64 78-24 190Z'/%3E%3Cpath fill='black' fill-opacity='.24' d='M-30 169C70 96 139 239 241 154C332 78 390 221 485 140C544 89 584 119 630 133L630 183C572 166 541 143 484 195C392 272 327 128 237 211C141 297 63 150-30 216Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath fill='black' fill-opacity='.34' d='M-30 70C75 4 140 142 232 64C322-12 400 135 485 48C544-12 586 22 630 44L630 91C574 62 540 38 484 101C394 191 324 42 236 124C143 210 72 63-30 128Z'/%3E%3Cpath fill='black' fill-opacity='.74' d='M-24 139C58 32 128 220 222 106C311-3 376 193 463 87C520 18 573 43 624 75L624 151C558 113 521 84 464 159C378 263 315 58 231 169C145 283 64 78-24 190Z'/%3E%3Cpath fill='black' fill-opacity='.24' d='M-30 169C70 96 139 239 241 154C332 78 390 221 485 140C544 89 584 119 630 133L630 183C572 166 541 143 484 195C392 272 327 128 237 211C141 297 63 150-30 216Z'/%3E%3C/svg%3E");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  mask-mode: alpha;
  filter: blur(1.2px) saturate(0.72) drop-shadow(0 0 12px rgba(74, 49, 35, 0.08));
  opacity: 0.70;
  transform: translate(var(--horse-ribbon-shift-x), var(--horse-ribbon-shift-y)) rotate(var(--horse-ribbon-rotation)) scaleX(var(--horse-ribbon-scale-x));
}

.horse-ribbon-surface::after {
  inset: -18% -10%;
  background: linear-gradient(
    96deg,
    transparent 3%,
    rgba(72, 49, 36, 0.12) 31%,
    rgba(112, 75, 50, 0.13) 57%,
    transparent 96%
  );
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath fill='black' fill-opacity='.68' d='M-20 91C89 172 125 38 232 119C321 186 383 70 463 121C523 159 566 99 620 115L620 137C554 122 523 184 456 144C382 99 319 211 226 142C125 67 76 201-20 116Z'/%3E%3Cpath fill='black' fill-opacity='.3' d='M-24 55C68 112 142 11 228 75C322 145 382 24 470 82C532 123 574 57 624 72L624 88C568 77 531 139 464 103C381 58 326 172 222 99C139 41 72 139-24 77Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath fill='black' fill-opacity='.68' d='M-20 91C89 172 125 38 232 119C321 186 383 70 463 121C523 159 566 99 620 115L620 137C554 122 523 184 456 144C382 99 319 211 226 142C125 67 76 201-20 116Z'/%3E%3Cpath fill='black' fill-opacity='.3' d='M-24 55C68 112 142 11 228 75C322 145 382 24 470 82C532 123 574 57 624 72L624 88C568 77 531 139 464 103C381 58 326 172 222 99C139 41 72 139-24 77Z'/%3E%3C/svg%3E");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  mask-mode: alpha;
  filter: blur(0.8px) drop-shadow(0 0 8px rgba(74, 49, 35, 0.07));
  opacity: 0.62;
  transform: translate(var(--horse-ribbon-shift-x-alt), var(--horse-ribbon-shift-y-alt)) rotate(var(--horse-ribbon-rotation-alt)) scaleX(var(--horse-ribbon-scale-x));
}

.horse-ribbon-surface > :not(dialog) {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .app-standard-hero h1 {
    font-size: 2.35rem;
  }
}

/* Contextual Premium bottom sheet. */
body.premium-upsell-open {
  overflow: hidden;
}

.premium-upsell-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #f6f0e8;
}

.premium-upsell-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.premium-upsell-dialog[open] {
  display: grid;
  align-items: end;
  justify-items: center;
}

.premium-upsell-sheet {
  width: min(620px, calc(100% - 2rem));
  max-height: min(82dvh, 720px);
  margin-bottom: max(1rem, env(safe-area-inset-bottom));
  padding: clamp(1.25rem, 4vw, 1.8rem);
  overflow-y: auto;
  border: 1px solid rgba(244, 238, 228, 0.15);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 0%, rgba(129, 68, 36, 0.25), transparent 18rem),
    #11100e;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.48);
  animation: premium-upsell-sheet-in 0.24s ease-out both;
}

.premium-upsell-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
}

.premium-upsell-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #ef8a49;
  background: rgba(228, 122, 53, 0.13);
  font-size: 1rem;
}

.premium-upsell-header h2,
.premium-upsell-description,
.premium-upsell-offer span,
.premium-upsell-offer small {
  margin: 0;
}

.premium-upsell-header h2 {
  color: #f6f0e8;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.premium-upsell-close {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(244, 238, 228, 0.16);
  border-radius: 50%;
  color: #f6f0e8;
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.premium-upsell-close:hover,
.premium-upsell-close:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(244, 238, 228, 0.3);
}

.premium-upsell-description {
  margin-top: 1rem;
  color: #b8aea5;
  font-size: 0.9rem;
  line-height: 1.55;
}

.premium-upsell-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  margin: 1.25rem 0;
  padding: 1.1rem 0;
  border-top: 1px solid rgba(244, 238, 228, 0.1);
  border-bottom: 1px solid rgba(244, 238, 228, 0.1);
  list-style: none;
}

.premium-upsell-benefits li {
  position: relative;
  padding-left: 1.25rem;
  color: #d5cbc1;
  font-size: 0.78rem;
  line-height: 1.4;
}

.premium-upsell-benefits li::before {
  position: absolute;
  left: 0;
  color: #9ecda8;
  content: "✓";
}

.premium-upsell-offer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.premium-upsell-offer span {
  color: #f6f0e8;
  font-size: 0.8rem;
}

.premium-upsell-offer strong {
  font-size: 2rem;
  letter-spacing: -0.06em;
}

.premium-upsell-offer small {
  color: #948a81;
  font-size: 0.72rem;
  text-align: right;
}

.premium-upsell-action {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  color: #18130f;
  background: #f5eee5;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.premium-upsell-action:hover,
.premium-upsell-action:focus-visible {
  color: #18130f;
  background: #fffaf3;
}

@keyframes premium-upsell-sheet-in {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .premium-upsell-sheet {
    width: 100%;
    max-height: min(86dvh, 720px);
    margin-bottom: 0;
    padding: 1.2rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 28px 28px 0 0;
  }

  .premium-upsell-benefits {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .premium-upsell-sheet {
    animation: none;
  }
}

/* Compact, accessible choice cards shared by horse and yard profile forms. */
.profile-choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.profile-choice-fieldset + .profile-choice-fieldset {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(244, 238, 228, 0.1);
}

.profile-choice-fieldset legend {
  margin-bottom: 0.35rem;
  color: var(--text, #f6f0e8);
  font-weight: 700;
}

.profile-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.profile-choice-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.18rem 0.55rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(244, 238, 228, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text, #f6f0e8);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.profile-choice-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.045);
}

.profile-choice-card:has(input:checked) {
  border-color: rgba(228, 122, 53, 0.8);
  background: rgba(228, 122, 53, 0.11);
}

.profile-choice-card:focus-within {
  outline: 2px solid rgba(239, 138, 73, 0.65);
  outline-offset: 2px;
}

.profile-choice-card input {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0.1rem 0 0;
  accent-color: #e47a35;
}

.profile-choice-card strong,
.profile-choice-card small {
  grid-column: 2;
  min-width: 0;
}

.profile-choice-card strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.profile-choice-card small {
  color: var(--muted, #aaa198);
  font-size: 0.75rem;
  line-height: 1.35;
}

.profile-choice-icon {
  grid-row: 1 / span 2;
  align-self: start;
  font-size: 1.05rem;
}

.profile-choice-card-subtle {
  opacity: 0.76;
}

@media (max-width: 620px) {
  .profile-choice-options,
  .profile-choice-options-four {
    grid-template-columns: 1fr;
  }
}
