/* shared/montura-look.css
   The shared look: buttons and their press animation match the iPhone app
   exactly (BUILD_SPEC "Shared look: app and desktop", values from the app's
   DesignSystem/Theme.swift). Any change here is made in the app in the same task.

   Use:  <link rel="stylesheet" href="/shared/montura-look.css">  AFTER the page's
   own <style>, then add the classes:
     .m-btn .m-btn-primary    full width, 56 high, accent fill, white 17 px semibold
     .m-btn .m-btn-outlined   full width, 56 high, background fill, 1 px hairline
     .m-btn .m-btn-quiet      full width, 44 high, no fill, accent 15 px medium
     .m-link                  text link, 44 high, accent 15 px medium
     .m-inline                add to any button that sits in a row instead of full width
     .m-press                 pressable card or row (scale 0.98 while held)
   Pages that support dark mode put data-m-theme="auto" on <html>. */

:root {
  --m-accent: #1D7FE2;
  --m-hairline: rgba(60, 60, 67, 0.29);
  --m-surface: #F2F2F7;
  --m-bg: #FFFFFF;
  --m-text: #111827;
  --m-on-accent: #FFFFFF;
  --m-r-control: 8px;
  --m-r-card: 10px;
  --m-press-ease: cubic-bezier(0.3, 1.3, 0.6, 1); /* spring 0.25 s, damping 0.7, slight overshoot */
}
@media (prefers-color-scheme: dark) {
  :root[data-m-theme="auto"] {
    --m-accent: #4A9EFA;
    --m-hairline: rgba(84, 84, 88, 0.6);
    --m-surface: #1C1C1E;
    --m-bg: #000000;
    --m-text: #F2F2F7;
  }
}
/* Forced dark (review pages, or a dark section on a light page). */
:root[data-m-theme="dark"], .m-theme-dark {
  --m-accent: #4A9EFA;
  --m-hairline: rgba(84, 84, 88, 0.6);
  --m-surface: #1C1C1E;
  --m-bg: #000000;
  --m-text: #F2F2F7;
}

.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border-radius: var(--m-r-control);
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background-image: none;
  box-shadow: none;
  transform: none;
  transition: transform 250ms var(--m-press-ease), opacity 250ms var(--m-press-ease);
  -webkit-tap-highlight-color: transparent;
}
.m-btn.m-btn-primary {
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  background: var(--m-accent);
  color: var(--m-on-accent);
  font-size: 17px;
  font-weight: 600;
}
.m-btn.m-btn-outlined {
  min-height: 56px;
  padding: 0 24px;
  border: 1px solid var(--m-hairline);
  background: var(--m-bg);
  color: var(--m-text);
  font-size: 17px;
  font-weight: 600;
}
.m-btn.m-btn-quiet {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--m-accent);
  font-size: 15px;
  font-weight: 500;
}
.m-btn.m-inline { width: auto; display: inline-flex; }

/* No lift, glow or gradient on hover: the app has none. */
.m-btn:hover, .m-btn:focus { transform: none; box-shadow: none; background-image: none; }
.m-btn.m-btn-primary:hover { background: var(--m-accent); color: var(--m-on-accent); }
.m-btn.m-btn-outlined:hover { background: var(--m-bg); color: var(--m-text); border-color: var(--m-hairline); }
.m-btn.m-btn-quiet:hover { background: none; color: var(--m-accent); }

/* Destructive (e.g. Cancel Subscription): outlined with red text (5.3:1 on white). */
.m-btn.m-destructive, .m-btn.m-destructive:hover { color: #D70015; }

/* Press: scale 0.97 and opacity 0.85 while held. (:not(:disabled) keeps this
   stronger than older page rules such as .btn:active:not(:disabled).)
   .is-pressed shows the held state on review pages. */
.m-btn:active:not(:disabled), .m-btn.is-pressed { transform: scale(0.97); opacity: 0.85; }
.m-btn:disabled, .m-btn[aria-disabled="true"] { cursor: default; transform: none; }
.m-btn.m-btn-primary:disabled, .m-btn.m-btn-primary[aria-disabled="true"] { opacity: 0.35; }
.m-btn:focus-visible, .m-link:focus-visible, .m-press:focus-visible {
  outline: 2px solid var(--m-accent);
  outline-offset: 2px;
}

/* Text link: pressed = 40% opacity, 120 ms ease-out. */
.m-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--m-accent);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 120ms ease-out;
}
.m-link:hover { background: none; transform: none; box-shadow: none; }
.m-link:active, .m-link.is-pressed { opacity: 0.4; }

/* Pressable cards and rows: scale 0.98 while held. */
.m-press { transition: transform 250ms var(--m-press-ease), opacity 250ms var(--m-press-ease); cursor: pointer; }
.m-press:active, .m-press.is-pressed { transform: scale(0.98); opacity: 0.85; }

/* Reduce Motion: opacity only. */
@media (prefers-reduced-motion: reduce) {
  .m-btn, .m-press { transition: opacity 250ms ease-out; }
  .m-btn:active:not(:disabled), .m-btn.is-pressed, .m-press:active, .m-press.is-pressed { transform: none; }
}
