/* =========================================================
   KAYLEE'S PRIVATE FLIP PHONE — V4
   ========================================================= */

.phone-message-section {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 46px 20px 58px;
  overflow: hidden;
  text-align: center;

  /* Fallback; JS copies the site's actual dotted background when possible. */
  background-color: #141210;
  background-image:
    radial-gradient(circle, rgba(93, 69, 52, .22) 0 1px, transparent 1.2px);
  background-size: 12px 12px;
  background-position: 0 0;

  /* Caboodle already supplies the divider above this section. */
  border: 0 !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(176, 143, 77, .65) !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.phone-message-section::before,
.phone-message-section::after {
  display: none !important;
  content: none !important;
}

.phone-message-heading {
  margin: 0 auto 20px !important;
}

.phone-message-heading h2 {
  margin-top: 0 !important;
}

/* =========================================================
   PHONE
   ========================================================= */

.flip-phone {
  position: relative;
  width: min(225px, 72vw);
  height: 407px;
  margin: 0 auto;
  transition: height .52s cubic-bezier(.22, .76, .28, 1);
  will-change: height;
}

.flip-phone-closed,
.flip-phone-open {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: opacity, transform;
}

.flip-phone-closed {
  z-index: 2;
  display: block;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity .30s ease,
    transform .50s cubic-bezier(.22, .76, .28, 1);
  -webkit-tap-highlight-color: transparent;
}

.flip-phone-closed-image,
.flip-phone-open-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* =========================================================
   EXTERNAL WALLPAPER
   Repositioned for the NEW transparent 933 x 1686 closed-phone PNG.
   ========================================================= */

.flip-phone-front-screen {
  position: absolute;
  left: 32.05%;
  top: 27.34%;
  width: 35.37%;
  height: 16.25%;
  z-index: 4;
  display: block;
  overflow: hidden;
  border-radius: 5%;
  pointer-events: none;
  background: transparent;
}

.flip-phone-front-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  filter:
    contrast(1.14)
    saturate(.88)
    brightness(.96);
  transform: scale(1.018);
}

/* Tiny RGB/pixel grid, like an early color-phone LCD. */
.flip-phone-front-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to right,
      rgba(255, 110, 110, .055) 0 1px,
      rgba(110, 255, 160, .035) 1px 2px,
      rgba(110, 170, 255, .05) 2px 3px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,.07) 0 1px,
      transparent 1px 3px
    );
  mix-blend-mode: multiply;
  opacity: .72;
}

/* Fine grain/old-LCD haze. */
.flip-phone-front-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-radial-gradient(
      circle at 20% 30%,
      rgba(255,255,255,.055) 0 1px,
      transparent 1px 3px
    );
  opacity: .32;
}

/* =========================================================
   OPEN / CLOSE ANIMATION
   ========================================================= */

.flip-phone.is-ringing .flip-phone-closed {
  animation: phone-ring-v4 .24s ease-in-out;
}

@keyframes phone-ring-v4 {
  0%   { transform: translate3d(0, 0, 0) rotate(0); }
  25%  { transform: translate3d(-1.5px, 0, 0) rotate(-1.2deg); }
  50%  { transform: translate3d(1.5px, 0, 0) rotate(1.2deg); }
  75%  { transform: translate3d(-1px, 0, 0) rotate(-.7deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0); }
}

.flip-phone-open {
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 12px, 0) scale(.965);
  transform-origin: center 48%;
  transition:
    opacity .32s ease,
    transform .52s cubic-bezier(.22, .76, .28, 1),
    visibility 0s linear .52s;
}

.flip-phone.is-opening .flip-phone-closed,
.flip-phone.is-open .flip-phone-closed {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -5px, 0) scale(.975);
}

.flip-phone.is-opening .flip-phone-open,
.flip-phone.is-open .flip-phone-open {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  transition-delay: 0s;
}

.flip-phone.is-open .flip-phone-open {
  pointer-events: auto;
}

.flip-phone.is-closing .flip-phone-open {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translate3d(0, 10px, 0) scale(.97);
}

.flip-phone.is-closing .flip-phone-closed {
  opacity: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(1);
}

/* =========================================================
   MESSAGE SCREEN
   ========================================================= */

.flip-phone-screen {
  position: absolute;
  left: 26.4%;
  top: 13.45%;
  width: 54.6%;
  height: 24.95%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 6px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background:
    linear-gradient(
      rgba(186, 215, 220, .98),
      rgba(150, 190, 198, .98)
    );
  color: #1e3437;
  font-family: "Courier New", Courier, monospace;
  text-align: left;
}

.flip-phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.045) 0,
      rgba(255,255,255,.045) 1px,
      rgba(0,0,0,.025) 2px,
      rgba(0,0,0,.025) 3px
    );
  opacity: .45;
}

.flip-phone-screen-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  gap: 3px;
}

.phone-screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(25, 51, 55, .45);
  font-size: 7px;
  font-weight: bold;
  line-height: 1;
}

.phone-field {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  font-size: 6px;
  font-weight: bold;
  line-height: 1;
}

.phone-field input,
.phone-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid rgba(34, 60, 64, .48);
  border-radius: 1px;
  outline: none;
  background: rgba(235, 247, 247, .82);
  color: #1f3538;
  font-family: "Courier New", Courier, monospace;
  font-size: 7px;
}

.phone-field input {
  height: 16px;
  padding: 2px 3px;
}

.phone-message-field {
  flex: 1 1 auto;
  min-height: 0;
}

.phone-field textarea {
  flex: 1 1 auto;
  min-height: 31px;
  padding: 3px;
  resize: none;
}

.phone-field input::placeholder,
.phone-field textarea::placeholder {
  color: rgba(38, 62, 65, .55);
}

.phone-field input:focus,
.phone-field textarea:focus {
  background: rgba(255,255,255,.94);
}

.phone-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.phone-send-button {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 3px 3px 2px;
  border: 1px solid rgba(30, 52, 55, .60);
  border-radius: 2px;
  background: rgba(237, 246, 244, .84);
  color: #223b3e;
  font-family: "Courier New", Courier, monospace;
  font-size: 7px;
  font-weight: bold;
  cursor: pointer;
}

.phone-send-button:active {
  transform: translateY(1px);
}

.phone-send-button:disabled {
  opacity: .55;
  cursor: wait;
}

.phone-message-success,
.phone-message-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  box-sizing: border-box;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 8px 6px;
  text-align: center;
  background:
    linear-gradient(
      rgba(186, 215, 220, .99),
      rgba(150, 190, 198, .99)
    );
  color: #1e3437;
  font-family: "Courier New", Courier, monospace;
}

.phone-message-success:not([hidden]),
.phone-message-error:not([hidden]) {
  display: flex;
}

.phone-message-success strong {
  display: block;
  font-size: 10px;
}

.phone-message-error {
  font-size: 8px;
}

.phone-hangup-button {
  position: absolute;
  left: 72%;
  top: 61%;
  width: 14%;
  height: 5.5%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 700px) {
  .phone-message-section {
    padding: 38px 12px 48px;
  }

  .flip-phone {
    width: min(245px, 75vw);
  }

  .phone-message-heading {
    margin-bottom: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flip-phone,
  .flip-phone-closed,
  .flip-phone-open {
    transition-duration: .01ms !important;
  }

  .flip-phone.is-ringing .flip-phone-closed {
    animation-duration: .01ms !important;
  }
}


/* =========================================================
   V7 FINAL BORDER OVERRIDE — keep this in phone-message.css
   ========================================================= */
html body #phone-message-section.phone-message-section {
  border-top: none !important;
  border-top-width: 0 !important;
  border-top-style: none !important;
  box-shadow: none !important;
}

html body #phone-message-section.phone-message-section::before,
html body #phone-message-section.phone-message-section::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
}
