/* Front-end auth modal — Mynote child override
 * Card-style dialog (desktop) / bottom sheet (mobile).
 * Brand colour: #04A4CC; dark text: #24292e; light bg: #fafbfc.
 */
.mynote-fm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 21, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.mynote-fm-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mynote-fm {
  position: fixed;
  z-index: 99999;
  /* Default: bottom-sheet */
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.16);
  padding: 24px 22px 28px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 260ms cubic-bezier(.2,.9,.3,1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #24292e;
  -webkit-overflow-scrolling: touch;
}
.mynote-fm.is-open {
  transform: translateY(0);
}
.mynote-fm__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #586069;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 120ms;
}
.mynote-fm__close:hover,
.mynote-fm__close:focus {
  background: #f1f3f5;
  color: #24292e;
  outline: none;
}
.mynote-fm__brand {
  text-align: center;
  margin: 4px 0 14px;
  font-size: 22px;
  font-weight: 600;
  color: #24292e;
}
.mynote-fm__brand .accent {
  color: #04A4CC;
}

.mynote-fm__tabs {
  display: flex;
  border-bottom: 1px solid #e1e4e8;
  margin: 0 0 18px;
}
.mynote-fm__tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 4px 12px;
  font-size: 14px;
  color: #586069;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms, border-color 120ms;
}
.mynote-fm__tab.is-active {
  color: #04A4CC;
  border-bottom-color: #04A4CC;
  font-weight: 500;
}

.mynote-fm__panel { display: none; }
.mynote-fm__panel.is-active { display: block; }

.mynote-fm__field { margin-bottom: 14px; }
.mynote-fm__field label {
  display: block;
  font-size: 13px;
  color: #586069;
  margin-bottom: 4px;
}
.mynote-fm__field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  color: #24292e;
  transition: border-color 120ms, box-shadow 120ms;
}
.mynote-fm__field input:focus {
  outline: none;
  border-color: #04A4CC;
  box-shadow: 0 0 0 3px rgba(4, 164, 204, 0.18);
}
.mynote-fm__hint {
  font-size: 12px;
  color: #6a737d;
  margin-top: 4px;
  line-height: 1.45;
}
.mynote-fm__hint a {
  color: #04A4CC;
  text-decoration: none;
}
.mynote-fm__hint a:hover { text-decoration: underline; }

.mynote-fm__submit {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: #04A4CC;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms, transform 80ms;
}
.mynote-fm__submit:hover { background: #0389aa; }
.mynote-fm__submit:active { transform: translateY(1px); }
.mynote-fm__submit:disabled {
  background: #99cdd9;
  cursor: not-allowed;
}

.mynote-fm__error {
  background: #ffebe9;
  border: 1px solid #ff8182;
  color: #b1261b;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.mynote-fm__error:empty { display: none; }

.mynote-fm__success {
  background: #dafbe1;
  border: 1px solid #1f883d;
  color: #1a6e2f;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.mynote-fm__success:empty { display: none; }

.mynote-fm__switch {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  color: #586069;
}
.mynote-fm__switch a {
  color: #04A4CC;
  text-decoration: none;
  cursor: pointer;
}
.mynote-fm__switch a:hover { text-decoration: underline; }

.mynote-fm__lostpw { /* alias for switch */ }

/* Desktop: centre as card */
@media (min-width: 600px) {
  .mynote-fm {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, calc(-50% + 16px));
    width: 420px;
    max-width: calc(100vw - 32px);
    border-radius: 14px;
    padding: 26px 26px 24px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transition: transform 240ms cubic-bezier(.2,.9,.3,1), opacity 180ms ease;
  }
  .mynote-fm.is-open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .mynote-fm__brand { margin: 2px 0 18px; font-size: 24px; }
}

/* Larger desktop tweak */
@media (min-width: 992px) {
  .mynote-fm { width: 440px; }
}

/* Body scroll lock helper */
body.mynote-fm-open { overflow: hidden; }

/* Trigger button hint — small pulse when first interactive */
.mynote-fm-trigger.is-armed {
  animation: mynote-fm-pulse 1.2s ease-out 1;
}
@keyframes mynote-fm-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(4,164,204,0.5); }
  100% { box-shadow: 0 0 0 14px rgba(4,164,204,0); }
}