@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap");

@font-face {
  font-family: Poppins;
  src: url("fonts/Poppins-Regular.ttf") format(truetype);
  font-weight: 500;
}

@font-face {
  font-family: Poppins;
  src: url("fonts/Poppins-Bold.ttf") format(truetype);
  font-weight: 700;
}

@font-face {
  font-family: Poppins;
  src: url("fonts/Poppins-Medium.ttf") format(truetype);
  font-weight: 500;
}

@font-face {
  font-family: Poppins;
  src: url("fonts/Poppins-Black.ttf") format(truetype);
  font-weight: 800;
}

@font-face {
  font-family: Poppins;
  src: url("fonts/Poppins-SemiBold.ttf") format(truetype);
  font-weight: 600;
}

:root {
  --clr-placeholder: #5b6670;
  --clr-heading: #022639;
  --clr-primary: #e03c31;
  --clr-primary-light: #f04e4e;
  --clr-grey-light: #d2d6d7;
  --clr-grey: #929294;
  --clr-black: #2c2c2c;
  --clr-btn-1st: #1b272c;
  --clr-background: #eef2f7;
  --clr-btn-2nd: #fdd;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  font-family: Poppins, Segoe UI, Helvetica, Arial, sans-serif;
}

body {
  font: 16px/1.4 Roboto, Segoe UI, Helvetica, Arial, sans-serif;
}

textarea {
  border: none;
  overflow: auto;
  outline: none;

  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;

  resize: none;
}

button {
  min-width: 12rem;
}

/* Wizard block */
.wizard {
  width: 100%;
  height: fit-content;
  margin: 0 auto;
  padding: 3rem;
  background: var(--clr-background);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.wizard__content {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  min-height: 440px;
}

.stretch {
  align-items: stretch;
}

/* Form Block */
.form {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  gap: 1.25rem;
}
.title {
  font-size: 1.5rem;
  font-weight: 600;
}

.form__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form__avatar-fields {
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Upload element */
.form__upload {
  border: 2px dashed var(--clr-primary-light);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1rem;
  cursor: pointer;
  color: #111;
}
.form__upload-reupload {
  color: var(--clr-primary);
  cursor: pointer;
}
.form__upload-note {
  display: block;
  font-size: 1rem;
  color: #505050;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Fields */
.form__fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form__field textarea {
  max-height: 10rem;
}

.form__label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}
.form__label-required {
  color: var(--clr-primary);
}
.form__input,
.form__select {
  font-family: Roboto, Segoe UI, Helvetica, Arial, sans-serif;
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  font-size: 1rem;
  width: 100%;
  background: #fff;
  transition: all 0.3s ease;
}
.form__input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form__input-error {
  color: var(--clr-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form__input.error {
  border-color: var(--clr-primary);
}

.form__input:hover,
.form__select:hover {
  border-color: var(--clr-primary);
}
.form__input:focus,
.form__select:focus {
  outline: none;
  border: 1px solid var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(224, 60, 49, 0.1);
}

/* Select wrapper */
.form__select-wrapper {
  position: relative;
  width: 100%;
}

.form__select-button {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  font-size: 1rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.form__select-button:hover {
  border-color: var(--clr-primary);
}

.form__select-button:focus {
  outline: none;
  border: 1px solid var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(224, 60, 49, 0.1);
}

.form__select-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100000;
  display: none;
  overflow: hidden;
}

.form__select-options.active {
  display: block;
}

.form__select-option {
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form__select-option:hover {
  background: var(--clr-background);
}

.form__select-option.selected {
  background: var(--clr-background);
}

.form__select-arrow {
  transition: transform 0.2s ease;
}

.form__select-arrow.active {
  transform: translateY(-50%) rotate(180deg);
}

.form__select {
  display: none;
}

/* Buttons */
.wizard__btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
}
.wizard__btn-next {
  margin-top: 2rem;
  color: #fff;
  border: none;
  border-radius: 36px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.wizard__btn-next-text {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0.75rem 2rem;
  border-radius: 36px;
  background: var(--clr-black);
}
.wizard__btn-next-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border-radius: 50%;
  background: var(--clr-black);
}

/* Preview */
.wizard__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.wizard__preview-box {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  overflow: hidden;
}
.wizard__preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.wizard__btn-1st,
.wizard__btn-2nd {
  border: none;
  cursor: pointer;
  line-height: normal;
  font-size: 1.125rem;
  border-radius: var(--radius-full);
  padding: 1rem 4rem;
  font: 18px/1.4 Roboto, Segoe UI, Helvetica, Arial, sans-serif;
  font-weight: 600;
}

.wizard__btn-1st {
  background-color: var(--clr-btn-1st);
  color: white;
}

.wizard__btn-2nd {
  background-color: white;
  color: var(--clr-btn-1st);
  border: 1px solid #c1c5c6;
}

.wizard__btn-1st:disabled,
.wizard__btn-2nd:disabled {
  opacity: 0.75;
  cursor: default;
}

#downloadBtn {
  min-width: 12rem;
}

.two-cols {
  grid-column: 1 / span 2;
}

.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  line-height: 1.4;
  position: relative;
}

.custom-checkbox .checkbox-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  word-break: break-word;
}

.custom-checkbox a {
  color: var(--clr-black);
  text-decoration: underline;
  display: inline;
  white-space: normal;
  word-break: normal;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-checkbox .checkmark {
  display: inline-block;
  height: 1.25rem;
  width: 1.25rem;
  border: 1px solid #bcbdbf;
  background-color: #e7e7e7;
  transition: all 0.2s ease-in-out;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.custom-checkbox input:checked + .checkmark {
  background-color: var(--clr-primary, #e03c31);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8L7 11L12 5' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 80%;
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.125rem;
  font-weight: 500;
  padding-left: 1.5rem;
}

.hidden {
  display: none !important;
}

.share-step {
  padding: 2rem 5rem;
  background-color: white;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4rem;
}

.share-step__btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.step-one-arrow__mobile {
  display: none;
}

.reverse {
  flex-direction: column-reverse;
}

.edit-tooltip-bubble {
  position: absolute;
  top: -3.125rem;
  left: 1.5rem;
  background: white;
  color: #1b272c;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 386px;
  animation: fadeIn 0.4s ease;
  z-index: 100;
  display: flex;
  gap: 0.75rem;
  align-items: start;
  border-radius: var(--radius);
}

.edit-tooltip-bubble .edit-tooltip-arrow {
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#ecardPreviewImage {
  width: auto;
  height: 100%;
  min-width: 480px;
}

.form__upload--mobile {
  display: none;
  border: 1px dashed #e03c31;
  background-color: #fff;
  color: var(--clr-black);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
}

.form__upload--mobile > svg {
  stroke: #e03c31;
}

.form__upload--mobile p {
  font-size: 1rem;
  font-weight: 400;
}

.form__upload--mobile .form__upload-note {
  font-size: 0.75rem;
  color: #505050;
  font-style: normal;
  margin-top: 0;
}

.custom-checkbox--mobile {
  display: none;
  margin-top: 1rem;
}

.wizard__btn-1st-text-mobile {
  display: none;
}

.upload-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.upload-status.success {
  color: #28a745 !important;
}

.upload-status.error {
  color: #e03c31 !important;
}

.upload-status svg {
  width: 16px;
  height: 16px;
}

/* ─────────────── Responsive ─────────────── */

@media (max-width: 1024px) {
  .wizard {
    padding: 1.5rem;
  }

  .wizard__content {
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
  }

  .form__container {
    grid-template-columns: 1fr;
    column-gap: 0;
    padding-left: 0;
  }

  .two-cols {
    grid-column: auto;
  }

  .wizard__preview-box canvas {
    width: 100% !important;
    height: auto !important;
    touch-action: none;
  }

  .wizard__btn-1st,
  .wizard__btn-2nd {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .wizard__preview-actions {
    flex-direction: column;
    gap: 1rem;
  }

  #stepOneArrow {
    display: none;
  }

  .share-step {
    padding: 2rem 1rem;
    gap: 2rem;
  }

  .share-step__btn-container {
    gap: 0.75rem;
  }

  .custom-checkbox {
    margin-left: 0;
  }

  #formPanel .custom-checkbox {
    display: none !important;
  }

  .custom-checkbox--mobile {
    display: block;
  }
}

@media (max-width: 600px) {
  .wizard {
    gap: 3rem;
  }

  .wizard__content {
    flex-direction: column;
    align-items: center;
    gap: 4rem;
  }

  .wizard__content.step-two {
    flex-direction: column-reverse;
    gap: 4rem;
  }

  .header {
    font-size: 1.375rem;
  }

  .form {
    width: 100%;
  }

  .form__input,
  .form__select,
  .form__label,
  .form__upload-note {
    font-size: 0.95rem;
  }

  .form__avatar-fields {
    grid-template-columns: 1fr 2fr;
    gap: 0.75rem;
  }

  .form__input-error {
    font-size: 0.75rem;
  }

  .form__upload {
    display: none !important;
  }

  .form__upload--mobile {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
  }

  .form__upload--mobile p {
    text-align: center;
  }

  .upload-status {
    font-size: 0.75rem;
    align-items: start;
    gap: 0.25rem;
  }

  .upload-status svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .form__field textarea {
    max-height: 10rem;
  }

  .checkbox__container {
    display: none;
  }

  .form__container {
    margin-bottom: 0;
  }

  .custom-checkbox {
    font-size: 0.75rem;
    gap: 0.75rem;
  }

  .custom-checkbox .checkmark {
    height: 1rem;
    width: 1rem;
  }

  #formPanel .custom-checkbox {
    display: none !important;
  }

  .custom-checkbox--mobile {
    display: block;
  }

  .wizard__btn-1st,
  .wizard__btn-2nd {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    max-width: 14rem;
  }

  #stepOneArrow {
    display: none;
  }

  .wizard__preview-actions-desktop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  #downloadBtn {
    max-width: 14rem;
  }

  .wizard__preview-box-tooltip {
    display: flex;
    background: white;
    font-weight: 700;
    color: var(--clr-black);
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    z-index: 100;
    gap: 0.75rem;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
    border: 0.5px solid #999;
  }

  .share-step {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    gap: 3rem;
  }

  .share-step__btn-container {
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
  }

  .share-list {
    font-size: 1rem;
    font-weight: 500;
    gap: 0.25rem;
  }

  #ecardPreviewImage {
    width: 100%;
    min-width: 320px;
    height: auto;
  }

  .edit-tooltip-bubble {
    top: -3.5rem;
    left: 0;
    padding: 0.75rem;
  }

  .wizard__preview-tooltip-arrow {
    margin-bottom: 1.5rem;
  }
}
