/* ============================================================
   MAYUNDA MODEL MANAGEMENT — Application Form Styles
   apply.css

   Depends on:
     Bootstrap 5        (cdn.jsdelivr.net)
     Bootstrap Icons    (cdn.jsdelivr.net)
     Google Fonts       Cormorant Garamond + Inter
============================================================ */

/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --gold:        #B8975A;
  --gold-light:  #D4B483;
  --gold-pale:   #F5EDD8;
  --ink:         #0E0E0E;
  --ink-soft:    #2A2A2A;
  --mist:        #F8F7F4;
  --border:      #E2DDD4;
  --error:       #C0392B;
  --success:     #2D6A4F;
  --radius:      4px;
  --radius-lg:   10px;
  --transition:  0.25s ease;
  --shadow-card: 0 4px 32px rgba(14,14,14,0.07);
}

/* ============================================================
   BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  background: var(--mist);
  color: var(--ink-soft);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   PAGE HEADER
============================================================ */
.page-header {
  padding: 80px 0 56px;
  text-align: center;
}

.page-header .eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.page-header h1 em {
  font-style: italic;
  color: var(--gold);
}

.page-header .intro {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 300;
  font-style: italic;
  color: #888;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.gold-rule {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 32px auto;
}

/* ============================================================
   FORM CARD
============================================================ */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(32px, 6vw, 64px);
  margin-bottom: 80px;
}

/* ============================================================
   SECTION HEADERS
============================================================ */
.section-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-header .section-number {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}

.section-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.form-section {
  margin-bottom: 52px;
}

.form-section:last-of-type {
  margin-bottom: 40px;
}

/* ============================================================
   INPUTS — FLOATING LABEL STYLE
============================================================ */
.field-wrap {
  position: relative;
  margin-bottom: 24px;
}

.field-wrap label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #999;
  pointer-events: none;
  transition: all var(--transition);
  background: #fff;
  padding: 0 4px;
}

/* Lifted / active label state */
.field-wrap input:focus ~ label,
.field-wrap input:not(:placeholder-shown) ~ label,
.field-wrap select:focus ~ label,
.field-wrap select.has-value ~ label {
  top: 0;
  font-size: 0.68rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.field-wrap input,
.field-wrap select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px 16px 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.field-wrap select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.field-wrap input:focus,
.field-wrap select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,151,90,0.12);
}

.field-wrap input.is-invalid,
.field-wrap select.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.08);
}

.field-wrap input.is-valid,
.field-wrap select.is-valid {
  border-color: #2D6A4F;
}

.field-error {
  font-size: 0.72rem;
  color: var(--error);
  margin-top: 6px;
  display: none;
  letter-spacing: 0.02em;
}

.field-error.visible { display: block; }

/* Measurement unit badge */
.unit-wrap {
  position: relative;
}

.unit-wrap input { padding-right: 60px; }

.unit-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  pointer-events: none;
}

/* ============================================================
   PHOTO UPLOAD ZONES
============================================================ */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 640px) {
  .upload-grid { grid-template-columns: 1fr; }
}

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
  background: var(--mist);
  text-align: center;
  padding: 24px 16px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-pale);
}

.upload-zone.is-invalid {
  border-color: var(--error);
}

.upload-zone .zone-icon {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 12px;
  transition: transform var(--transition);
}

.upload-zone:hover .zone-icon { transform: translateY(-3px); }

.upload-zone .zone-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.upload-zone .zone-hint {
  font-size: 0.7rem;
  color: #aaa;
  letter-spacing: 0.04em;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Preview state */
.upload-zone.has-preview .zone-content { display: none; }

.preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 2px);
  display: none;
}

.upload-zone.has-preview .preview-img { display: block; }

.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14,14,14,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: calc(var(--radius-lg) - 2px);
}

.upload-zone.has-preview:hover .preview-overlay { display: flex; }

.preview-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
}

.preview-btn:hover { background: rgba(255,255,255,0.3); }

.upload-zone-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #aaa;
  text-align: center;
  margin-top: 10px;
}

/* ============================================================
   TERMS CHECKBOX
============================================================ */
.terms-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 28px;
  background: var(--mist);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
  cursor: pointer;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: #fff;
  margin-top: 2px;
}

.terms-wrap input[type="checkbox"] { display: none; }

.terms-wrap input[type="checkbox"]:checked ~ .custom-checkbox {
  background: var(--gold);
  border-color: var(--gold);
}

.terms-wrap input[type="checkbox"]:checked ~ .custom-checkbox::after {
  content: '';
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

.terms-text {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.6;
}

.terms-text a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-light);
  transition: color var(--transition);
}

.terms-text a:hover { color: var(--ink); }

/* ============================================================
   SUBMIT BUTTON
============================================================ */
.btn-apply {
  width: 100%;
  padding: 20px 40px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.btn-apply::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold) 0%, #8B6C3A 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-apply:hover:not(:disabled)::before { opacity: 1; }
.btn-apply:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(184,151,90,0.3); }
.btn-apply:active:not(:disabled) { transform: translateY(0); }

.btn-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-apply span { position: relative; z-index: 1; }
.btn-apply .spinner { position: relative; z-index: 1; }

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

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

/* ============================================================
   SUCCESS / ERROR PANELS
============================================================ */
.result-panel {
  display: none;
  text-align: center;
  padding: 64px 32px;
  animation: fadeUp 0.5s ease;
}

.result-panel.visible { display: block; }

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

.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 28px;
}

.result-icon.success-icon { background: #E8F5F0; color: var(--success); }
.result-icon.error-icon   { background: #FDF0EF; color: var(--error); }

.result-panel h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 16px;
}

.result-panel p {
  font-size: 0.9rem;
  color: #777;
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-retry:hover { background: var(--ink); color: #fff; }

/* Animated checkmark */
.checkmark-svg { width: 36px; height: 36px; }

.checkmark-path {
  stroke: var(--success);
  stroke-width: 3;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: drawCheck 0.6s ease 0.2s forwards;
}

@keyframes drawCheck { to { stroke-dashoffset: 0; } }

/* ============================================================
   FORM PROGRESS DOTS
============================================================ */
.form-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 48px;
}

.prog-step {
  display: flex;
  align-items: center;
  gap: 0;
}

.prog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition);
}

.prog-dot.active { background: var(--gold); }

.prog-line {
  width: 32px;
  height: 1px;
  background: var(--border);
}

@media (max-width: 480px) { .prog-line { width: 16px; } }

/* ============================================================
   LOADING OVERLAY
============================================================ */
.form-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(3px);
  border-radius: var(--radius-lg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.form-loading-overlay.visible { display: flex; }

.form-loading-overlay .big-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================================
   ACCESSIBILITY — FOCUS
============================================================ */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ============================================================
   CONFETTI PARTICLES
============================================================ */
.confetti-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
