* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #eceeef;
  font-family: Arial, sans-serif;
  color: #242424;
}

.page {
  width: 100%;
  min-height: 100vh;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  background:
    radial-gradient(circle at 12% 20%, rgba(185, 20, 30, 0.08), transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.08), transparent 26%),
    linear-gradient(135deg, #f8f8f8, #e5e5e5);
}

.postcard {
  width: min(1180px, 100%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
}


.front-card {
  height: 410px;
  background: #f6f6f6;
}

.front-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

.front-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      95deg,
      rgba(255, 255, 255, 0.97) 0%,
      rgba(255, 255, 255, 0.88) 30%,
      rgba(255, 255, 255, 0.25) 58%,
      rgba(255, 255, 255, 0.02) 100%
    );
  z-index: 1;
}

.front-overlay::after {
  content: "";
  position: absolute;
  left: -70px;
  bottom: -110px;
  width: 430px;
  height: 230px;
  background: #878787;
  border-radius: 50%;
  opacity: 0.92;
}

.front-content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 44px 58px 38px;
}

.brand {
  width: 320px;
  text-align: left;
}
.brand img{
    width: 120px;
    height: 60px;
}

.logo {
  width: 245px;
  height: 100px;
  height: auto;
  display: block;
  object-fit: contain;
  mix-blend-mode: multiply;
}


.hero-text h1 {
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1.15;
  color: #333;
  font-weight: 500;
}

.hero-text h1 span {
  display: block;
  color: #b91520;
  font-style: italic;
  font-size: 44px;
}


.hero-text p {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.45;
  color: #242424;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.btn {
  min-width: 150px;
  height: 50px;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  transition: 0.22s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.red-btn {
  background: linear-gradient(145deg, #d71924, #a90e16);
  color: white;
  box-shadow: 0 14px 30px rgba(197, 22, 32, 0.24);
}

.red-btn img {
  filter: brightness(0) invert(1);
}

.outline-btn {
  color: #333;
  border: 1px solid rgba(197, 22, 32, 0.55);
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.outline-btn img {
  filter: invert(17%) sepia(88%) saturate(2740%) hue-rotate(343deg) brightness(83%) contrast(91%);
}


.service-strip {
  position: absolute;
  left: 43%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 120px));
  min-height: 58px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.service-strip div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-right: 1px solid rgba(197, 22, 32, 0.18);
  color: #222;
  font-weight: 800;
  font-size: 14px;
}

.service-strip div:last-child {
  border-right: none;
}

.service-strip img {
  width: 27px;
  height: 27px;
  object-fit: contain;
  filter: invert(17%) sepia(88%) saturate(2740%) hue-rotate(343deg) brightness(83%) contrast(91%);
}

/* BACK */
.back-card {
  min-height: 405px;
  background:
    radial-gradient(circle at 25% 70%, rgba(0, 0, 0, 0.04), transparent 28%),
    linear-gradient(135deg, #ffffff, #f0f0f0);
  padding: 52px 70px;
  display: grid;
  grid-template-columns: 1fr 1px 1.05fr;
  gap: 58px;
}

.airmail-border {
  position: absolute;
  inset: 0;
  border: 14px solid transparent;
  border-radius: 20px;
  background:
    repeating-linear-gradient(
      135deg,
      #c51620 0 18px,
      #f4f4f4 18px 40px,
      #6c7378 40px 58px,
      #f4f4f4 58px 80px
    ) border-box;
  pointer-events: none;

  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;

  mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.message-side,
.address-side {
  position: relative;
  z-index: 2;
}

.message-side h2 {
  font-family: Georgia, serif;
  font-size: 38px;
  color: #2c2c2c;
  font-style: italic;
  font-weight: 400;
}

.message-side h2 span {
  color: #b91520;
}


.message-side p {
  max-width: 360px;
  margin: 25px;
  font-size: 16px;
  line-height: 1.72;
  color: #444;
}



.postcard-sketch {
  height: 115px;
  position: relative;
  margin-top: 18px;
  opacity: 0.45;
}

.sketch-line {
  position: absolute;
  left: 0;
  right: 10px;
  bottom: 20px;
  height: 1px;
  border-top: 2px dashed #b7b7b7;
}

.sketch-city {
  position: absolute;
  right: 25px;
  bottom: 18px;
  width: 230px;
  height: 85px;
  border-bottom: 2px solid #c9c9c9;
  background:
    linear-gradient(to top, transparent 0 20px, rgba(0,0,0,0.06) 20px 21px, transparent 21px),
    radial-gradient(circle at 65% 55%, transparent 0 28px, rgba(0,0,0,0.08) 29px 31px, transparent 32px);
  clip-path: polygon(0 100%, 8% 75%, 15% 90%, 25% 70%, 34% 88%, 45% 55%, 57% 82%, 70% 45%, 83% 80%, 100% 62%, 100% 100%);
}

.sketch-plane {
  position: absolute;
  left: 120px;
  top: 10px;
  color: #777;
  font-size: 22px;
  transform: rotate(-15deg);
}

.signature {
  position: absolute;
  left: 70px;
  bottom: 38px;
  font-family: Georgia, serif;
  font-style: italic;
  color: #333;
  font-size: 18px;
}

.signature-text img{
    width: 25px;
    height: 25px;
    position: relative;
    left: 210px;
    bottom: 55px;
}

.signature::before {
  content: "▯";
  color: #c51620;
  font-size: 55px;
  position: absolute;
  left: -58px;
  top: -12px;
}

.signature::after {
  content: "♡";
  color: #c51620;
  margin-left: 12px;
}


.divider {
  width: 1px;
  min-height: 300px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.22) 0 6px,
    transparent 6px 12px
  );
  z-index: 2;
}

.stamp-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  margin-bottom: 42px;
}

.stamp-lines {
  display: grid;
  gap: 7px;
}

.stamp-lines span {
  width: 110px;
  height: 2px;
  background: rgba(0,0,0,0.22);
  border-radius: 50%;
}

.stamp-box {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(0,0,0,0.25);
  color: #b91520;
  font-size: 52px;
  font-family: Georgia, serif;
  font-weight: 800;
}

.to-row {
  display: grid;
  grid-template-columns: 55px 1fr;
  align-items: end;
  gap: 15px;
  margin-bottom: 24px;
}

.to-row label {
  font-family: Georgia, serif;
  color: #b91520;
  font-size: 32px;
  font-style: italic;
}

.to-row span,
.address-lines span {
  display: block;
  height: 1px;
  background: rgba(0,0,0,0.45);
}

.address-lines {
  display: grid;
  gap: 22px;
  margin-bottom: 42px;
}

.contact-area {
  display: grid;
  grid-template-columns: 1fr 145px;
  gap: 32px;
  align-items: end;
}

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #333;
}

.contact-item span {
  width: 30px;
  height: 30px;
  background: linear-gradient(145deg, #d71924, #a90e16);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.contact-item img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.contact-item strong {
  font-size: 16px;
  font-weight: 700;
}

.qr-box {
  width: 116px;
  height: 116px;
  border: 1px solid rgba(197, 22, 32, 0.5);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.75);
}

.qr img {
  width: 100px;
  height: 100px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}



.bottom-actions {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.bottom-actions button {
  height: 62px;
  border: none;
  border-radius: 18px;
  color: white;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  transition: 0.22s ease;
}

.bottom-actions button:hover {
  transform: translateY(-3px);
}

.bottom-actions img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.save-btn {
  background: linear-gradient(145deg, #555, #222);
  box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

.share-btn {
  background: linear-gradient(145deg, #d71924, #a90e16);
  box-shadow: 0 14px 32px rgba(197, 22, 32, 0.26);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(30px);
  background: #222;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  padding: 20px;
}

.popup-overlay.hide {
  display: none;
}

.popup-box {
  width: 350px;
  max-width: 90%;
  background: white;
  border-radius: 20px;
  padding: 28px 22px 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
}

.popup-close {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #f1f1f1;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.popup-icon {
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: popupShow 0.35s ease;
}

.popup-icon img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  display: block;
}

.popup-box h2 {
  font-size: 28px;
  color: #222;
  font-family: sans-serif;
  margin-bottom: 12px;
  line-height: 1.35;
}
.popup-box p{
  font-size: 20px;
  margin-bottom: 8px;
  padding: 5px;
}

.popup-btn {
  border: none;
   text-decoration: none;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  background: #ff1f1f;
  color: white;
  padding: 13px 24px;
  border-radius: 9px;
  font-size: 15px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .front-card {
    height: 560px;
  }

  .front-overlay {
    background:
      linear-gradient(
        to bottom,
        rgba(255,255,255,0.96) 0%,
        rgba(255,255,255,0.85) 42%,
        rgba(255,255,255,0.12) 100%
      );
  }

  .front-content {
    padding: 34px 26px 26px;
  }

  .brand {
    width: 260px;
  }

  .logo {
    width: 220px;
  }

  .service-strip {
    width: calc(100% - 34px);
    grid-template-columns: repeat(2, 1fr);
    border-radius: 22px;
    bottom: 18px;
  }

  .service-strip div {
    padding: 13px 4px;
  }

  .back-card {
    grid-template-columns: 1fr;
    padding: 46px 30px;
    gap: 28px;
  }

  .divider {
    display: none;
  }

  .contact-area {
    grid-template-columns: 1fr;
  }

  .signature {
    position: relative;
    left: auto;
    bottom: auto;
    margin-top: 25px;
    padding-left: 58px;
  }

  .bottom-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .page {
    padding: 14px;
  }

  .front-card {
    height: 610px;
    border-radius: 18px;
  }

  .back-card {
    border-radius: 18px;
  }

  .hero-text h1 {
    font-size: 28px;
  }

  .hero-text h1 span {
    font-size: 38px;
  }

  .hero-actions {
    flex-direction: column;
    width: 190px;
  }

  .service-strip {
    grid-template-columns: 1fr;
  }

  .stamp-row {
    justify-content: space-between;
  }

  .stamp-lines span {
    width: 82px;
  }

  .contact-item strong {
    font-size: 14px;
  }
}



/* =========================
   EXTRA RESPONSIVE FIX
   Add this at the END of style.css
========================= */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}


/* Tablet */
@media (max-width: 768px) {
  .page {
    padding: 18px 12px;
    gap: 24px;
  }

  .postcard {
    width: 100%;
    border-radius: 18px;
  }

  .front-card {
    height: auto;
    min-height: 560px;
  }

  .front-bg {
    object-position: center;
  }

  .front-content {
    min-height: 560px;
    padding: 28px 22px 170px;
  }

  .brand {
    width: 100%;
  }

  .brand img {
    width: 110px;
    height: auto;
  }

  .hero-text {
    margin-top: 28px;
  }

  .hero-text h1 {
    font-size: 30px;
    line-height: 1.2;
  }

  .hero-text h1 span {
    font-size: 40px;
  }

  .hero-text p {
    font-size: 15px;
    line-height: 1.7;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .btn {
    min-width: 140px;
    height: 46px;
    font-size: 14px;
    border-radius: 12px;
  }

  .service-strip {
    left: 50%;
    bottom: 22px;
    width: calc(100% - 36px);
    transform: translateX(-50%);
    grid-template-columns: repeat(2, 1fr);
    border-radius: 22px;
  }

  .service-strip div {
    min-height: 56px;
    font-size: 13px;
    border-bottom: 1px solid rgba(197, 22, 32, 0.18);
  }

  .service-strip img {
    width: 23px;
    height: 23px;
  }

  .back-card {
    grid-template-columns: 1fr;
    padding: 42px 24px 34px;
    gap: 28px;
    min-height: auto;
  }

  .airmail-border {
    border-width: 10px;
  }

  .message-side h2 {
    font-size: 32px;
  }

  .message-side p {
    max-width: 100%;
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.8;
  }

  .signature-text img {
    position: static;
    width: 24px;
    height: 24px;
    margin-top: 8px;
  }

  .divider {
    display: none;
  }

  .stamp-row {
    margin-bottom: 28px;
    gap: 16px;
  }

  .stamp-box {
    width: 78px;
    height: 78px;
    font-size: 42px;
  }

  .to-row {
    grid-template-columns: 45px 1fr;
    gap: 10px;
  }

  .to-row label {
    font-size: 28px;
  }

  .address-lines {
    gap: 18px;
    margin-bottom: 30px;
  }

  .contact-area {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .contact-list {
    gap: 10px;
  }

  .contact-item {
    gap: 9px;
  }

  .contact-item span {
    width: 28px;
    height: 28px;
  }

  .contact-item strong {
    font-size: 14px;
    word-break: break-word;
  }

  .qr-box {
    width: 115px;
    height: 115px;
    margin: 0 auto;
  }

  .qr img {
    width: 94px;
    height: 94px;
  }

  .toast {
    width: calc(100% - 30px);
    text-align: center;
    font-size: 13px;
  }
}


/* Mobile */
@media (max-width: 540px) {
  .page {
    padding: 12px 10px;
    gap: 20px;
  }

  .postcard {
    border-radius: 16px;
  }

  .front-card {
    min-height: 650px;
  }

  .front-content {
    min-height: 650px;
    padding: 24px 18px 300px;
  }

  .front-overlay {
    background:
      linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 255, 255, 0.9) 48%,
        rgba(255, 255, 255, 0.18) 100%
      );
  }

  .front-overlay::after {
    width: 260px;
    height: 160px;
    left: -90px;
    bottom: -70px;
  }

  .brand img {
    width: 100px;
  }

  .hero-text {
    margin-top: 24px;
  }

  .hero-text h1 {
    font-size: 26px;
  }

  .hero-text h1 span {
    font-size: 34px;
  }

  .hero-text p {
    font-size: 14px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 210px;
  }

  .btn {
    width: 100%;
    min-width: unset;
  }

  .service-strip {
    grid-template-columns: 1fr;
    width: calc(100% - 30px);
    border-radius: 18px;
    bottom: 18px;
  }

  .service-strip div {
    justify-content: flex-start;
    padding: 12px 18px;
    min-height: 48px;
    border-right: none;
  }

  .back-card {
    padding: 36px 18px 28px;
  }

  .message-side h2 {
    font-size: 29px;
  }

  .message-side p {
    font-size: 14px;
    line-height: 1.8;
  }

  .bottom-signature {
    display: block;
  }

  .stamp-row {
    align-items: center;
    justify-content: space-between;
  }

  .stamp-box {
    width: 68px;
    height: 68px;
    font-size: 36px;
  }

  .stamp-lines span {
    width: 72px;
  }

  .to-row label {
    font-size: 25px;
  }

  .contact-item strong {
    font-size: 13px;
  }

  .popup-box {
    width: 100%;
    max-width: 330px;
    padding: 24px 18px 22px;
  }

  .popup-box h2 {
    font-size: 24px;
  }

  .popup-box p {
    font-size: 16px;
  }
}


/* Very small phones */
@media (max-width: 380px) {
  .front-card {
    min-height: 680px;
  }

  .front-content {
    min-height: 680px;
    padding-bottom: 320px;
  }

  .hero-text h1 {
    font-size: 24px;
  }

  .hero-text h1 span {
    font-size: 31px;
  }

  .service-strip div {
    font-size: 12px;
  }

  .contact-item {
    align-items: flex-start;
  }

  .contact-item strong {
    font-size: 12px;
    line-height: 1.5;
  }
}