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

body {
  background: #292021;
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
}

.page {
  background: #292021;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 32px;
  padding: 24px;
}

/* Header */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -1.44px;
  text-align: center;
  color: #ffffff;
  text-transform: none;
}

.title-accent {
  color: #c8102e;
}

.subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.54px;
  text-align: center;
  color: #a19595;
}

.progress {
  display: flex;
  gap: 8.344px;
  align-items: center;
  justify-content: center;
}

.progress-dash {
  background: #c8102e;
  height: 2.608px;
  width: 42.242px;
  display: block;
}

/* Divider */
.divider {
  display: block;
  width: 100%;
  height: 1px;
  border: none;
}

/* Intro */
.intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.intro-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.72px;
  color: #ffffff;
  line-height: normal;
}

.intro-text {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.48px;
  color: #a19595;
}

/* Upload section */
.upload-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.upload-box {
  background: rgba(247, 244, 229, 0.05);
  border: 1px dashed #ffffff;
  border-radius: 8px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

.upload-trigger {
  height: 232px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  cursor: pointer;
}

.upload-icon {
  display: block;
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
}

.upload-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  width: 223px;
}

.upload-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.48px;
  color: #ffffff;
}

.upload-hint {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: -0.36px;
  color: #a19595;
}

/* Name field */
.name-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.name-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.48px;
  color: #ffffff;
}

.name-input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  background: rgba(247, 244, 229, 0.05);
  border: 1px solid rgba(225, 190, 190, 0.6);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  outline: none;
}

.name-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.name-input:focus {
  border-color: #c8102e;
  background: rgba(247, 244, 229, 0.08);
}

/* Gender field */
.gender-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.photo-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.gender-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.48px;
  color: #ffffff;
}

.photo-label {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.48px;
  color: #ffffff;
}

.gender-select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  background: rgba(247, 244, 229, 0.05);
  border: 1px solid rgba(225, 190, 190, 0.6);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  outline: none;
  cursor: pointer;
}

.gender-select:focus {
  border-color: #c8102e;
  background: rgba(247, 244, 229, 0.08);
}

.gender-select option {
  background: #292021;
  color: #ffffff;
}

/* Subscribe link */
.btn-subscribe {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  color: #a19595;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-decoration: underline;
  text-align: center;
  transition: color 0.2s;
}

.btn-subscribe:hover {
  color: #ffffff;
}

.consent-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}

.consent-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: #f7f4e5;
  border: 0.5px solid rgba(225, 190, 190, 0.6);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 1px;
}

.consent-checkbox:checked {
  background: #c8102e;
}

.consent-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #f7f4e5;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-label {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.48px;
  color: #ffffff;
  cursor: pointer;
}

/* Card preview */
.card-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 400px;
}

.card-rotate {
  position: relative;
  width: 200px;
}

.card-image {
  display: block;
  width: 100%;
  height: auto;
}

.user-photo {
  position: absolute;
  top: 38%;
  left: 50%;
  width: 63%;
  height: auto;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 50%;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.user-photo:active {
  cursor: grabbing;
}

.photo-hint {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: rgba(41, 32, 33, 0.75);
  border: 1px solid rgba(225, 190, 190, 0.4);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  pointer-events: none;
  z-index: 2;
}

.photo-hint span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-name {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  display: block;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: #3a1f1f;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: #292021;
  border: 1px solid rgba(225, 190, 190, 0.6);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.modal-text {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #ffffff;
  line-height: 1.5;
}

.modal-close {
  flex: none;
  align-self: center;
  width: 100%;
  max-width: 200px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.modal-actions .btn {
  flex: none;
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  white-space: normal;
  line-height: 1.2;
}

@media (min-width: 1024px) {
  .modal-box {
    max-width: 420px;
    padding: 32px;
  }

  .modal-text {
    font-size: 20px;
  }

  .modal-actions {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }

  .modal-actions .btn {
    flex: 1;
    width: auto;
    min-height: 48px;
    font-size: 16px;
  }

  .modal-close {
    width: auto;
    min-width: 160px;
  }
}

/* Actions */
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.btn {
  flex: 1;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: 'Oswald', sans-serif;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.btn-share {
  background: #f7f4e5;
  color: #292021;
}

.btn-save {
  background: #c8102e;
  color: #ffffff;
}

/* ===================== Desktop (PC) ===================== */
@media (min-width: 1024px) {
  .page {
    max-width: 1324px;
    margin: 0 auto;
    padding: 66px 24px;
    gap: 84px;
  }

  .header {
    gap: 24px;
  }

  .title {
    font-size: 96px;
    letter-spacing: -2.88px;
    line-height: 71px;
  }

  .subtitle {
    font-size: 24px;
    letter-spacing: -0.72px;
  }

  .progress {
    gap: 16px;
    margin-top: 8px;
  }

  .progress-dash {
    width: 81px;
    height: 5px;
  }

  .intro {
    gap: 16px;
  }

  .intro-title {
    font-size: 48px;
    letter-spacing: -1.4px;
  }

  .intro-text {
    font-size: 20px;
    letter-spacing: -0.6px;
    max-width: 850px;
  }

  .upload-section {
    display: grid;
    grid-template-columns: 777px 1fr;
    column-gap: 56px;
    row-gap: 40px;
    grid-template-areas:
      "name card"
      "gender card"
      "upload card"
      "consent card"
      "actions card"
      "subscribe card";
    align-items: start;
  }

  .upload-box {
    grid-area: upload;
    width: 777px;
    height: auto;
  }

  .name-field {
    grid-area: name;
  }

  .gender-field {
    grid-area: gender;
  }

  .photo-field {
    grid-area: upload;
    width: 777px;
  }

  .upload-trigger {
    height: 275px;
  }

  .upload-icon {
    width: 84px;
    height: 84px;
  }

  .upload-title {
    font-size: 20px;
    letter-spacing: -0.6px;
  }

  .upload-hint {
    font-size: 18px;
    letter-spacing: -0.54px;
  }

  .consent-row {
    grid-area: consent;
  }

  .consent-checkbox {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .consent-checkbox:checked::after {
    left: 10px;
    top: 6px;
    width: 8px;
    height: 15px;
  }

  .consent-label {
    font-size: 23px;
    letter-spacing: -0.69px;
    max-width: 727px;
  }

  .card-preview {
    grid-area: card;
    height: 609px;
    width: 433px;
    align-self: start;
    justify-self: center;
  }

  .card-rotate {
    width: 311px;
  }

  .card-name {
    font-size: 38px;
    top: 62%;
    width: 76%;
  }

  .name-label {
    font-size: 23px;
    letter-spacing: -0.69px;
  }

  .gender-label {
    font-size: 23px;
    letter-spacing: -0.69px;
  }

  .photo-label {
    font-size: 23px;
    letter-spacing: -0.69px;
  }

  .name-input {
    height: 64px;
    font-size: 20px;
    padding: 0 24px;
  }

  .gender-select {
    height: 64px;
    font-size: 20px;
    padding: 0 24px;
  }

  .btn-subscribe {
    grid-area: subscribe;
    font-size: 18px;
  }

  .actions {
    grid-area: actions;
    width: auto;
    gap: 24px;
  }

  .btn {
    flex: none;
    width: 320px;
    height: auto;
    padding: 18px 40px;
    font-size: 20px;
  }
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.loader.is-open {
  display: flex;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #c8102e;
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #ffffff;
}

.camera-box {
  gap: 16px;
}

.camera-video {
  width: 100%;
  max-width: 320px;
  height: auto;
  max-height: 50vh;
  border-radius: 8px;
  background: #000000;
  object-fit: cover;
}

.camera-canvas {
  display: none;
}
