.coupon-modal {
  --teal: #008083;
  --teal-dark: #004050;
  --text: #1c2a3a;
  --muted: #7b889d;
  --border: #d8e1ef;
  --bg: #ffffff;
  --el-height: 44px;
}

* {
  box-sizing: border-box;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
  z-index: 1000;
}

.modal-overlay.is-open {
  display: grid;
}

.coupon-modal {
  width: min(500px, 100% - 2rem);
  background: var(--bg);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  color: var(--text);
  transition: 1s ease;

  @starting-style {
    transform: translateY(0.5rem);
    opacity: 0;
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 1.25rem;
    border-bottom: 1px solid #eff3fa;
  }

  .modal-body {
    padding: 1.25rem;
  }

  .coupon-box {
    width: 100%;

    p:not(:last-child) {
      font-size: 20px;
      font-weight: 600;
      color: var(--teal);
      margin-bottom: 12px;
    }
  }
}

.modal-title {
  margin: 0;
  font-weight: 700;
  color: var(--teal-dark);
  font-size: 1.5rem !important;
  line-height: 1.2;
}

.modal-close {
  --btn-dimension: 32px;
  flex: 0 0 auto;
  width: var(--btn-dimension);
  height: var(--btn-dimension);
  display: grid;
  place-content: center;
  border-radius: 10px;
  border: 1px solid var(--teal-dark);
  background: #f9fbff;
  color: #7a879b;
  cursor: pointer;
  padding: 0px !important;

  span {
    font-size: 26px;
    line-height: 0;
  }

  &:hover {
    background: var(--teal-dark);

    span {
      color: var(--bg);
    }
  }
}

/* Step 1 */
.modal-lead {
  margin: 0;
  color: #4a5a73;
  font-size: 1.05rem;
  line-height: 1.45;
}

.modal-form {
  display: grid;
  gap: 12px;
  margin-block: 1rem 0.75rem;
}

.modal-input {
  width: 100%;
  height: var(--el-height) !important;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}

.modal-input::placeholder {
  color: #a7b2c5;
}

.modal-input:focus {
  border-color: rgba(26, 160, 163, 0.7);
  box-shadow: 0 0 0 4px rgba(26, 160, 163, 0.16);
}

.modal-primary {
  width: 100%;
  height: var(--el-height) !important;
  border-radius: 10px;
  border: none;
  background: var(--teal);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.modal-primary:hover {
  background: var(--teal-dark);
}

.modal-fineprint {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.4;
  text-align: center;
}

/* Step 2 */
.modal-coupon_block {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  padding: 1.25rem;
  position: relative;

  .modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
  }

  h2 {
    font-size: 1.5rem !important;
    margin-bottom: 0px !important;

    @media (width<=500px) {
      font-size: 1.25rem !important;
      width: 100% !important;
      text-align: start !important;
    }
  }

  p#couponCode {
    margin-bottom: 0px !important;
    font-size: clamp(2rem, 1.519rem + 1.538vw, 2.75rem) !important;
    color: var(--teal);
    border: 2px dashed var(--teal);
    padding: 3rem 0rem;
    width: 100%;
    border-radius: 16px;
    user-select: all;
    background-color: #f4f4f4;

    &::selection {
      background-color: var(--teal-dark);
      color: var(--bg);
    }
  }

  p#couponMessage {
    margin-bottom: 0px !important;
    font-weight: 600;
  }

  button#copyBtn {
    width: 100%;
    height: var(--el-height) !important;
    border-radius: 10px;
    border: none;
    background: var(--teal);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    cursor: pointer;

    &:hover {
      background: var(--teal-dark);
    }
  }
}

.success-icon {
  --icon-size: 72px;
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: 100vw;
  background: var(--teal-dark);
  color: var(--bg);
  display: grid;
  place-content: center;
}

.modal-success-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f1f35;
  font-size: 2rem;
}

.coupon-card {
  width: 100%;
  border: 2px dashed rgba(26, 160, 163, 0.8);
  border-radius: 14px;
  padding: 18px 18px 16px;
  background: #fbfeff;
}

.coupon-label {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.coupon-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.modal-note {
  display: grid;
  gap: 6px;
  color: var(--muted);
  margin-top: -2px;
}

.modal-note p {
  margin: 0;
  line-height: 1.4;
}

.modal-note .muted {
  color: #97a4b8;
}

/* Helpers */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#couponMessage {
  border: 2px solid;
  padding: 7px;
  border-radius: 8px;
  border-color: rgb(254 215 170 / var(--tw-border-opacity, 1));
  color: #f78104;
  background-color: rgb(255 247 237 / var(--tw-bg-opacity, 1));
}


/* 15-4-26 */

.reopen-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;

  width: 60px;
  height: 60px;
  border-radius: 50%;

  background: #008083;
  border: none;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 9999;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}


.reopen-btn:hover {
  transform: scale(1.1);
  background: #004050;
}

.reopen-btn.hidden {
  display: none;
}

.reopen-btn {
  opacity: 0;
  transform: scale(0.8);
}

.reopen-btn:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}

.reopen-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}