*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

body {
  font-family: "Cause", cursive;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  background: linear-gradient(
    -45deg,
    #ff9a56,
    #ffcd3c,
    #ff85a1,
    #87ceeb,
    #ffd166
  );
  background-size: 400% 400%;
  animation: summerGradient 12s ease infinite;
  color: #dddddd;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 6px;
}

@keyframes summerGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ── Falling stars ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orbs span {
  position: absolute;
  width: 1px;
  height: var(--len, 160px);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
  border-radius: 100px;
  top: var(--y, -10%);
  left: var(--x, 50%);
  opacity: 0;
  animation: fallingStar var(--dur, 6s) linear infinite var(--delay, 0s);
}

.bg-orbs span:nth-child(1) {
  --x: 3%;
  --y: -15%;
  --dur: 5s;
  --delay: 0s;
  --len: 200px;
}
.bg-orbs span:nth-child(2) {
  --x: 12%;
  --y: -8%;
  --dur: 7s;
  --delay: -2s;
  --len: 150px;
}
.bg-orbs span:nth-child(3) {
  --x: 22%;
  --y: -18%;
  --dur: 6s;
  --delay: -4s;
  --len: 240px;
}
.bg-orbs span:nth-child(4) {
  --x: 31%;
  --y: -6%;
  --dur: 8s;
  --delay: -1s;
  --len: 180px;
}
.bg-orbs span:nth-child(5) {
  --x: 40%;
  --y: -12%;
  --dur: 5.5s;
  --delay: -3s;
  --len: 210px;
}
.bg-orbs span:nth-child(6) {
  --x: 50%;
  --y: -5%;
  --dur: 9s;
  --delay: -6s;
  --len: 160px;
}
.bg-orbs span:nth-child(7) {
  --x: 58%;
  --y: -20%;
  --dur: 6.5s;
  --delay: -5s;
  --len: 220px;
}
.bg-orbs span:nth-child(8) {
  --x: 67%;
  --y: -10%;
  --dur: 7.5s;
  --delay: -7s;
  --len: 175px;
}
.bg-orbs span:nth-child(9) {
  --x: 75%;
  --y: -14%;
  --dur: 5.8s;
  --delay: -9s;
  --len: 190px;
}
.bg-orbs span:nth-child(10) {
  --x: 99%;
  --y: -7%;
  --dur: 8.5s;
  --delay: -8s;
  --len: 140px;
}
.bg-orbs span:nth-child(11) {
  --x: 111%;
  --y: -16%;
  --dur: 6.2s;
  --delay: -10s;
  --len: 230px;
}
.bg-orbs span:nth-child(12) {
  --x: 127%;
  --y: -9%;
  --dur: 7.2s;
  --delay: -3s;
  --len: 155px;
}
.bg-orbs span:nth-child(13) {
  --x: 7%;
  --y: -22%;
  --dur: 5.2s;
  --delay: -11s;
  --len: 260px;
}
.bg-orbs span:nth-child(14) {
  --x: 17%;
  --y: -11%;
  --dur: 9.5s;
  --delay: -4s;
  --len: 170px;
}
.bg-orbs span:nth-child(15) {
  --x: 27%;
  --y: -4%;
  --dur: 6.8s;
  --delay: -12s;
  --len: 200px;
}
.bg-orbs span:nth-child(16) {
  --x: 45%;
  --y: -17%;
  --dur: 7.8s;
  --delay: -2s;
  --len: 250px;
}
.bg-orbs span:nth-child(17) {
  --x: 65%;
  --y: -9%;
  --dur: 5.4s;
  --delay: -13s;
  --len: 185px;
}
.bg-orbs span:nth-child(18) {
  --x: 93%;
  --y: -13%;
  --dur: 8.2s;
  --delay: -6s;
  --len: 215px;
}
.bg-orbs span:nth-child(19) {
  --x: 108%;
  --y: -6%;
  --dur: 6.1s;
  --delay: -14s;
  --len: 145px;
}
.bg-orbs span:nth-child(20) {
  --x: 128%;
  --y: -19%;
  --dur: 7.4s;
  --delay: -8s;
  --len: 235px;
}

@keyframes fallingStar {
  0% {
    opacity: 0;
    transform: rotate(35deg) translateY(0);
  }
  8% {
    opacity: 0.9;
  }
  92% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: rotate(35deg) translateY(130vh);
  }
}

/* ── Layout ── */
.layout {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 150px;
  padding: 50px 8px;
}

.logo-panel {
  width: 100%;
  border-radius: 1rem;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 24px;
}

.logo-panel img {
  height: 120px;
  object-fit: contain;
}

.logo-panel img.logo-small {
  height: 40px;
}

.logo-panel img.logo-mrirw {
  height: 8vh;
}

/* ── Main card ── */
.card {
  min-width: 0;
  width: 100%;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(18px);
  /* border: 1px solid rgba(255, 255, 255, 0.45); */
  border-radius: 2rem;
  box-shadow: 0px 0px 30px 30px rgba(0, 0, 0, 0.5);
  /* box-shadow:
    0px 0px 25px 25px rgba(255, 255, 255, 0.4),
    inset 0px 0px 25px 25px rgba(255, 255, 255, 0.5); */
}

.card h1.title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  color: #dddddd;
  margin-bottom: 12px;
}

.card .subtitle {
  color: #dddddd;
  font-size: 1rem;
  text-align: center;
  font-style: italic;
  margin-bottom: 32px;
}

/* ── Form ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #dddddd;
}

.input-text {
  width: 100%;
  padding: 12px;
  border-radius: 0.8rem;
  border: 0;
  background-color: rgba(0, 0, 0, 0.3);
  color: #dddddd;
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: box-shadow 0.15s;
}

.input-text::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.input-text:focus {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.btn-primary {
  width: 50%;
  align-self: flex-end;
  background-color: rgba(0, 0, 0, 0.3);
  color: #dddddd;
  font-weight: 700;
  padding: 12px;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.5);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Result section ── */
.result-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-section.hidden {
  display: none;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading.hidden {
  display: none;
}

.loader {
  border: 4px solid rgba(0, 0, 0, 0.2);
  border-top: 4px solid rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 2s linear infinite;
}

.trademark {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.2);
  font-weight: 800;
  font-style: italic;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.status-text {
  color: #dddddd;
  font-size: 0.875rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.image-container {
  margin-top: 16px;
  width: 100%;
}

.image-container.hidden {
  display: none;
}

.image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

#finalImage {
  width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(0, 0, 0, 0.4);
}

.prompt-display {
  font-size: 0.75rem;
  color: #dddddd;
  margin-top: 8px;
  text-align: center;
  font-style: italic;
  word-wrap: break-word;
}

/* ── Email section ── */
.email-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  width: 100%;
}

.email-section label {
  font-size: 1rem;
  font-weight: 500;
  color: #dddddd;
}

.email-row {
  display: flex;
  gap: 8px;
}

.input-email {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border-radius: 0.5rem;
  border: none;
  background-color: rgba(0, 0, 0, 0.4);
  color: #dddddd;
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.15s;
}

.input-email::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.input-email:focus {
  background-color: rgba(0, 0, 0, 0.5);
}

.btn-send {
  background-color: rgba(0, 0, 0, 0.3);
  color: #dddddd;
  font-weight: 700;
  padding: 12px 16px;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s;
}

.btn-send:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.5);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.email-status {
  font-size: 0.875rem;
  text-align: center;
}

.email-status.hidden {
  display: none;
}
.email-status.info {
  color: rgb(195, 189, 185);
}
.email-status.ok {
  color: #dddddd;
}
.email-status.error {
  color: #f87171;
}

/* ── Reset button ── */
.btn-reset {
  margin-top: 48px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  color: #dddddd;
  font-weight: 700;
  padding: 12px;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s;
}

.btn-reset:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

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

/* ── Reset modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  padding: 40px 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.modal-text {
  color: #ffe8d6;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 16px;
}

.modal-btn {
  padding: 12px 36px;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s;
}

.modal-btn-yes {
  background-color: rgba(0, 0, 0, 0.4);
  color: #dddddd;
}

.modal-btn-yes:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-btn-no {
  background-color: rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.modal-btn-no:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

.validation_label {
  color: #ea1919;
  font-size: 1rem;
  text-align: center;
  margin-top: 8px;
  display: none;
}

@media (min-width: 1280px) {
  .modal-text {
    font-size: 1.75rem;
  }

  .modal-btn {
    padding: 16px 48px;
    font-size: 1.5rem;
  }
}

/* ── Responsive: side logos on wide screens ── */
@media (min-width: 1280px) {
  .layout {
    align-items: center;
    gap: 35px;
  }

  .bg-orbs span {
    width: 5px;
  }

  .demo-label {
    font-size: 5rem;
  }

  .logo-panel {
    gap: 16px 88px;
  }

  .card {
    width: 75%;
    padding: 20px;
    border-radius: 2rem;
    margin-top: 20px;
  }

  .card h1.title {
    font-size: 3.5rem;
  }

  .card .subtitle {
    font-size: 1rem;
  }

  .btn-primary {
    width: 30%;
    padding: 20px;
    font-size: 1.5rem;
  }

  .form-group {
    margin-top: 50px;
  }

  .form-group label {
    font-size: 1rem;
  }

  .form-group input {
    padding: 10px;
    font-size: 1rem;
  }

  .status-text {
    font-size: 1.25rem;
  }

  .email-section {
    max-width: 600px;
  }

  .email-section label {
    font-size: 1.5rem;
  }

  .input-email {
    padding: 20px;
    font-size: 1.5rem;
  }

  .btn-send {
    padding: 20px 28px;
    font-size: 1.5rem;
  }

  .email-status {
    font-size: 1.25rem;
  }

  .btn-reset {
    padding: 20px;
    font-size: 1.5rem;
  }
}

/* ── Responsive: 4K displays (3840px+) ── */
@media (min-width: 3840px) {
  .layout {
    gap: 150px;
  }

  .card {
    width: 70%;
    padding: 160px;
    border-radius: 5rem;
    box-shadow: 0px 0px 50px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
  }

  .bg-orbs span {
    width: 7px;
  }

  .card h1.title {
    font-size: 12rem;
  }

  .card .subtitle {
    font-size: 4.5rem;
  }

  .form-group {
    margin-top: 260px;
    gap: 32px;
  }

  .form-group label {
    font-size: 5rem;
  }

  .form-group input {
    padding: 36px;
    font-size: 3.5rem;
    border-radius: 1rem;
  }

  .btn-primary {
    width: 30%;
    margin-top: 50px;
    padding: 36px;
    font-size: 4rem;
    border-radius: 1rem;
  }

  .validation_label {
    font-size: 3.5rem;
  }

  .status-text {
    font-size: 2rem;
  }

  .loader {
    width: 80px;
    height: 80px;
    border-width: 8px;
  }

  .email-section {
    max-width: 1100px;
  }

  .email-section label {
    font-size: 2.5rem;
  }

  .input-email {
    padding: 36px;
    font-size: 2.5rem;
    border-radius: 1rem;
  }

  .btn-send {
    padding: 36px 48px;
    font-size: 3rem;
    border-radius: 1rem;
  }

  .email-status {
    font-size: 2rem;
  }

  .btn-reset {
    padding: 36px;
    font-size: 4rem;
    border-radius: 1rem;
    margin-top: 80px;
  }

  .modal {
    max-width: 1000px;
  }

  .modal-text {
    font-size: 3rem;
  }

  .modal-btn {
    padding: 28px 80px;
    font-size: 2.5rem;
  }

  .logo-panel img {
    height: 300px;
  }

  .logo-panel img.logo-small {
    height: 80px;
  }
}
