/* The hiring manager's iPhone: Messages, then the gateKeeper review in the browser.
   Messages follows the HR Tech demo's TextMessageScreen (RecruitOS.Extension demo/hm/hm-message.css). */
/* Laid out at a real iPhone's 390 x 844 CSS pixels, so the copied product CSS behaves as it does on a
   phone, then scaled to fit the window (--phone-scale is set from the window size in overlays.mjs). */
.iphone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 390px;
  height: 844px;
  transform: translate(-50%, -50%) scale(var(--phone-scale, 0.85));
  border: 12px solid #2b2b30;
  border-radius: 60px;
  background: #000;
  box-shadow: 0 0 0 2px #5c5f66, 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.island {
  position: absolute;
  z-index: 3;
  top: 1.4%;
  left: 50%;
  width: 31%;
  height: 4%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.phoneLayer[data-screen='lock'] .lockScreen,
.phoneLayer[data-screen='messages'] .messagesScreen,
.phoneLayer[data-screen='loading'] .reviewScreen,
.phoneLayer[data-screen='review'] .reviewScreen { display: flex; }

.messagesScreen {
  background: #fff;
  color: #000;
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}
.statusBar { padding: 4.2% 9% 0; font-size: 15px; font-weight: 600; }
.threadHeader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8% 0 3%;
  border-bottom: 1px solid #e5e5ea;
  background: #f7f7f7;
  font-size: 12px;
}
.contactAvatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(#a5a9b3, #858993); }
.threadTime { margin: 14px 0 8px; text-align: center; color: #8e8e93; font-size: 11px; }
.messageBubble {
  align-self: flex-start;
  max-width: 76%;
  margin-left: 12px;
  padding: 9px 13px;
  border-radius: 18px;
  background: #efefef;
  font-size: 15.5px;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom left;
}
.messageBubble.isIn { opacity: 1; transform: none; transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.magicLink { color: #188dd8; text-decoration: underline; word-break: break-all; }
.composeBar {
  margin: auto 10px 22px;
  padding: 8px 14px;
  border: 1px solid #d1d1d6;
  border-radius: 18px;
  color: #c7c7cc;
  font-size: 14px;
}
.reviewScreen { background: #f4f2f8; }

/* The review screen inside the phone: plum status bar, the review, then Safari's address bar. */
.reviewScreen { color: var(--hmr-ink); font-family: 'Poppins', -apple-system, Arial, sans-serif; }
.statusBar--dark { background: #200940; color: #fff; padding-bottom: 6px; }
.reviewViewport { position: relative; flex: 1; overflow: hidden; }
.reviewViewport .hmr { height: 100%; min-height: 0; }
.reviewViewport .hmr-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
/* The product pins these to the browser window; in the phone they pin to the screen. */
.reviewViewport .hmr-actions,
.reviewViewport .hmr-sheet-layer { position: absolute; }
.safariBar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 14px 22px;
  background: #f9f9f9;
  border-top: 1px solid #e5e5ea;
  color: #1c1c1e;
  font-family: -apple-system, 'SF Pro Text', Arial, sans-serif;
}
.safariAa { font-size: 14px; }
.safariUrl {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #e9e9eb;
  font-size: 14px;
}
.safariReload { color: #1c1c1e; }

/* The toolkit's Button (ss-ui-toolkit) as the reject sheet uses it. */
.ssBtn--outline, .ssBtn--primary {
  padding: 11px 16px;
  border-radius: 5px;
  font: 500 15px 'Poppins', Arial, sans-serif;
  cursor: pointer;
}
.ssBtn--outline { border: 1px solid #5a29a9; background: #fff; color: #5a29a9; }
.ssBtn--primary { border: 1px solid #5a29a9; background: #5a29a9; color: #fff; }
.ssBtn--primary:disabled { opacity: 0.45; cursor: default; }

/* Beside the phone during the review: what this screen is. */
.reviewAside {
  position: absolute;
  left: calc(50% + 390px * var(--phone-scale, 0.85) / 2 + 48px);
  top: 50%;
  max-width: 300px;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.reviewAside.isIn { opacity: 1; visibility: visible; }
.reviewAside h2 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: -0.02em; }
.reviewAside p { margin: 8px 0 0; color: var(--lavender); }

/* The ending, once the decisions are back: book a demo, or rewind to the start. */
.finale {
  position: absolute;
  left: 50%;
  bottom: 3vh;
  z-index: 36;
  display: flex;
  align-items: center;
  gap: 18px;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.finale.isIn { opacity: 1; visibility: visible; }
/* Once the ending shows, the caption steps up to make room for it. */
#stage .caption { transition: bottom 0.4s ease; }
#stage.isFinale .caption { bottom: calc(3vh + 72px); }
.finaleCta {
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(239, 17, 142, 0.35);
}
.finaleReplay {
  border: 0;
  background: none;
  white-space: nowrap;
  color: var(--lavender);
  font: 500 14px var(--font);
  cursor: pointer;
}
@media (max-width: 900px) {
  .reviewAside { display: none; }
}

/* Lock screen with the text notification, matching the 3D phone's painted screen (paint.mjs). */
.lockScreen {
  align-items: center;
  background: linear-gradient(170deg, #200940 0%, #5a29a9 65%, #ef118e 100%);
  color: #fff;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}
.lockScreen .statusBar { align-self: stretch; }
.lockDate { margin: 70px 0 0; font-size: 20px; font-weight: 600; }
.lockTime { margin: 0; font-size: 96px; font-weight: 700; line-height: 1; letter-spacing: -2px; }
.lockNotification {
  display: flex;
  gap: 10px;
  width: calc(100% - 20px);
  margin-top: 150px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  color: #000;
  font-size: 14px;
  text-align: left;
}
.lockAppIcon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #34c759; }
.lockSender { display: flex; justify-content: space-between; margin: 0; }
.lockSender span { color: #6e6e73; font-size: 12px; }
.lockPreview { margin: 2px 0 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.homeIndicator { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; border-radius: 3px; background: #fff; transform: translateX(-50%); }

/* A finger tap: a ring that swells and fades where the visitor "taps". */
.tapRipple {
  position: absolute;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(239, 17, 142, 0.35);
  box-shadow: 0 0 0 3px rgba(239, 17, 142, 0.7);
  opacity: 0;
  pointer-events: none;
}
.tapRipple--notification { left: 50%; top: 360px; }
.tapRipple--link { left: 55%; bottom: 12px; }
.messageBubble { position: relative; }
.isTapping .tapRipple { animation: tap 0.7s ease-out infinite; }
@keyframes tap {
  0% { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.4); }
}

/* Safari opening the magic link: a blank page with the app's plum header, and a progress line. */
.pageLoading { position: absolute; inset: 0 0 auto; height: 100%; background: #f4f2f8; display: none; }
.pageLoading__header { height: 64px; background: #200940; }
.phoneLayer[data-screen='loading'] .pageLoading { display: block; top: 30px; height: calc(100% - 92px); }
.safariBar { position: relative; }
.safariProgress { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: #0a84ff; }
.phoneLayer[data-screen='loading'] .safariProgress { width: var(--load, 0%); }

@media (prefers-reduced-motion: reduce) {
  .isTapping .tapRipple { animation: none; opacity: 0.8; }
}

.phoneLayer[data-screen='loading'] .hmr-actions { display: none; }

/* Phone scenes on wide screens: the caption and the next-scene hint sit beside the phone, not over it. */
@media (min-width: 901px) {
  #stage.isPhone .caption,
  #stage.isPhone .nextHint {
    left: calc(50% + 390px * var(--phone-scale, 0.85) / 2 + 48px);
    right: var(--gutter);
    max-width: 320px;
    text-align: left;
    transform: none;
  }
  #stage.isPhone .caption { top: auto; bottom: calc(50% + 0.4em); }
  #stage.isPhone .nextHint { top: calc(50% + 0.8em); bottom: auto; align-items: flex-start; }
}
