/*
   event.css: 메인 청첩장 디자인 시스템 기반 컴팩트 스타일
   - 스크롤을 최소화하여 모바일 한 화면에 핵심 액션(정보입력 + 사진선택 + 전달)이 쏙 들어오도록 최적화
*/

:root {
  --paper: #faf7f1;
  --paper-deep: #f1ece2;
  --card: #ffffff;
  --line: #e7e0d2;
  --line-soft: #efe9dc;
  --ink: #2a2522;
  --ink-bright: #2b2720;
  --soft: #625853;
  --faint: #857a74;
  --rose: #bd5d7c;
  --rose-soft: #e7c3cf;
  --leaf: #5a7a5e;
  --gold: #b08d4f;
  --serif: 'Gowun Batang', 'Playfair Display', serif;
  --sans: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, Pretendard, sans-serif;
  --script: 'Dancing Script', cursive;
}

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

body {
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 꽃잎 장식 */
.petals {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 40;
  width: min(100%, 430px);
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-50%);
}

.petals i {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 40% 40%, rgba(255, 225, 230, 0.95), rgba(240, 185, 195, 0.6) 70%, transparent 100%);
  border-radius: 99px 10px 99px 10px;
  opacity: 0;
  animation: fall 11s linear infinite;
}

.petals i:nth-child(1) { left: 12%; animation-delay: 0s;   animation-duration: 9s; }
.petals i:nth-child(2) { left: 38%; animation-delay: 2.5s; animation-duration: 11s; }
.petals i:nth-child(3) { left: 68%; animation-delay: 1.2s; animation-duration: 12s; }
.petals i:nth-child(4) { left: 88%; animation-delay: 4.2s; animation-duration: 9.5s; }

@keyframes fall {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { opacity: 0; transform: translate3d(20px, 105vh, 0) rotate(360deg); }
}

/* 페이퍼 컨테이너 (컴팩트 패딩) */
.paper {
  position: relative;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    radial-gradient(400px 300px at 0% 15%, rgba(244, 214, 218, 0.35), transparent 70%),
    radial-gradient(400px 300px at 100% 50%, rgba(244, 214, 218, 0.3), transparent 70%),
    var(--paper);
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  padding: 20px 22px 40px;
}

/* 상단 네비게이션 */
.top-nav {
  margin-bottom: 12px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--soft);
  text-decoration: none;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 99px;
  transition: all 0.2s ease;
}

.nav-back:hover {
  border-color: var(--rose);
  color: var(--rose);
}

/* 컴팩트 헤더 */
.event-header {
  text-align: center;
  margin-bottom: 20px;
}

.event-label {
  font-family: var(--script);
  font-size: 22px;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 2px;
}

.event-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-bright);
  margin-bottom: 6px;
}

.event-desc {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  color: var(--soft);
  word-break: keep-all;
}

.event-desc b {
  color: var(--ink-bright);
  font-weight: 600;
}

/* 폼 그룹 */
.form-field {
  margin-bottom: 14px;
}

/* 성함 & 연락처 2컬럼 가로 압축 배치 */
.form-row-compact {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  margin-bottom: 14px;
}

.form-field-compact {
  display: flex;
  flex-direction: column;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-bright);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.field-label .req {
  color: var(--rose);
}

.field-label .sub-hint {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--rose);
  margin-left: 2px;
  letter-spacing: -0.01em;
}

/* 입력 인풋 */
.custom-input {
  width: 100%;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-input::placeholder {
  color: var(--faint);
  font-size: 13.5px;
}

.custom-input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(189, 93, 124, 0.1);
}

/* 모바일 인풋 행 형태의 명확하고 시원한 업로드 액션 바 */
.upload-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px -6px rgba(95, 75, 55, 0.08);
  transition: all 0.2s ease;
  user-select: none;
}

.upload-action-row:hover,
.upload-action-row.dragover {
  border-color: var(--rose);
  background: #fffcfc;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(189, 93, 124, 0.18);
}

.upload-action-row:active {
  transform: scale(0.99);
}

.uar-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.uar-icon {
  font-size: 22px;
  line-height: 1;
}

.uar-text {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-bright);
  letter-spacing: -0.01em;
}

.uar-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--rose);
  background: #fdf3f6;
  border: 1px solid var(--rose-soft);
  border-radius: 99px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px -2px rgba(189, 93, 124, 0.15);
}

.upload-action-row:hover .uar-btn {
  background: var(--rose);
  color: #ffffff;
  border-color: var(--rose);
}

.uar-caption {
  font-size: 12.5px;
  color: var(--soft);
  margin-top: 8px;
  padding-left: 4px;
  line-height: 1.5;
}

/* 썸네일 그리드 */
.media-preview-container {
  margin-top: 10px;
}

.media-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--soft);
  margin-bottom: 6px;
  padding: 0 2px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.media-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #eee8dc;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.media-card img,
.media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(42, 37, 34, 0.8);
  color: #ffffff;
}

.media-remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(42, 37, 34, 0.65);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

.media-remove-btn:hover {
  background: var(--rose);
}

/* 하단 버튼 & 간결한 파기 안내 */
.submit-btn-wrap {
  text-align: center;
  margin-top: 18px;
}

.submit-btn {
  display: inline-block;
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #fdf3f6, #fbf6ec);
  border: 1px solid var(--rose-soft);
  border-radius: 99px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--rose);
  cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(189, 93, 124, 0.35);
  transition: all 0.2s ease;
}

.submit-btn:hover {
  border-color: var(--rose);
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  background: #ece7dc;
  border-color: var(--line);
  color: var(--soft);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.privacy-tiny {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 10px;
  line-height: 1.4;
}

/* 토스트 알림 */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(42, 37, 34, 0.94);
  color: #faf7f1;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-width: 88vw;
  text-align: center;
  word-break: keep-all;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 프로그레스 모달 */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 37, 34, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.progress-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.progress-modal {
  background: var(--paper);
  border-radius: 16px;
  padding: 30px 24px 26px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--line);
}

.progress-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-bright);
  margin-bottom: 6px;
}

.progress-status {
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 16px;
  word-break: break-all;
}

.progress-bar-wrap {
  background: #ede6d8;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transition: width 0.15s ease;
}

.progress-percent {
  font-size: 12px;
  font-weight: 600;
  color: var(--rose);
}

.success-view {
  display: none;
}

.success-view.show {
  display: block;
}

.success-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-bright);
  margin-bottom: 10px;
}

.success-desc {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--soft);
  line-height: 1.8;
  margin-bottom: 22px;
  word-break: keep-all;
}

.home-btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--rose);
  background: linear-gradient(135deg, #fdf3f6, #fbf6ec);
  border: 1px solid var(--rose-soft);
  border-radius: 99px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.home-btn:hover {
  border-color: var(--rose);
}
