/* ════════════════════════════════════════════════════════════
   Portfolia — Create / Form Page Styles
   ════════════════════════════════════════════════════════════ */

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

:root {
  --cream: #F5F0E8;
  --ink: #1A1612;
  --ink-light: #6B6460;
  --accent: #C84B2F;
  --accent-warm: #E8A87C;
  --white: #FFFFFF;
  --border: rgba(26,22,18,0.14);
  --success: #2E7D32;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius: 14px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.create-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 3rem;
  background: rgba(245,240,232,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.progress-container {
  flex: 1;
  height: 4px;
  background: rgba(26,22,18,0.1);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 14.28%;
}

.step-counter {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-light);
  flex-shrink: 0;
}

/* ── Main ── */
.create-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

#portfolioForm {
  width: 100%;
  max-width: 580px;
}

/* ── Form Steps ── */
.form-step {
  display: none;
  animation: stepIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-step.active { display: block; }
.form-step.exit { animation: stepOut 0.3s ease forwards; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-32px); }
}

.step-meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.step-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.step-hint {
  color: var(--ink-light);
  font-size: 0.9375rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ── Inputs ── */
.input-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.form-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200,75,47,0.1); }
.form-input::placeholder { color: rgba(26,22,18,0.35); }

.large-input { font-size: 1.375rem; padding: 1.25rem 1.25rem; }

.form-textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.input-label {
  position: absolute;
  top: -0.625rem;
  left: 0.875rem;
  background: var(--cream);
  padding: 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}
.form-input:focus ~ .input-label { color: var(--accent); }

.char-count {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--ink-light);
}

/* ── Quick Picks ── */
.quick-picks, .service-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.quick-pick-label {
  font-size: 0.8125rem;
  color: var(--ink-light);
  margin-right: 0.25rem;
}

.pick-btn, .chip-btn {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 0.35rem 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}
.pick-btn:hover, .chip-btn:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.chip-btn.selected {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* ── Upload Zone ── */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(200,75,47,0.03);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-label { font-weight: 500; margin-bottom: 0.25rem; }
.upload-sub { font-size: 0.8125rem; color: var(--ink-light); }

.image-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.preview-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--border);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: rgba(26,22,18,0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-or {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--ink-light);
  font-size: 0.875rem;
}
.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Link Adder ── */
.link-label { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.link-inputs { display: flex; flex-direction: column; gap: 0.5rem; }
.link-row { display: flex; gap: 0.5rem; align-items: center; }
.link-input { flex: 1; }
.remove-link {
  width: 36px; height: 36px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  font-size: 1.125rem;
  cursor: pointer;
  color: var(--ink-light);
  transition: var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.remove-link:hover { background: var(--ink); color: white; border-color: var(--ink); }
.add-link-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  transition: var(--transition);
}
.add-link-btn:hover { opacity: 0.7; }

/* ── Contact Fields ── */
.contact-fields { display: flex; flex-direction: column; gap: 1rem; }

/* ── Template Selector ── */
.template-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.template-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.template-option input[type="radio"] { display: none; }

.template-thumb {
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  height: 110px;
  transition: var(--transition);
}
.template-option:hover .template-thumb { border-color: var(--accent-warm); }
.template-option input:checked ~ .template-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,75,47,0.15);
}

/* Template thumbs */
.minimal-thumb { background: #fff; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.thumb-nav { height: 12px; background: #eee; border-radius: 2px; }
.thumb-hero { padding: 4px 0; display: flex; flex-direction: column; gap: 3px; }
.thumb-title { height: 8px; background: #ddd; border-radius: 2px; width: 80%; }
.thumb-sub { height: 5px; background: #eee; border-radius: 2px; width: 55%; }
.thumb-grid { display: flex; gap: 3px; margin-top: 4px; }
.thumb-grid > div { flex: 1; height: 24px; background: #f0f0f0; border-radius: 3px; }

.bold-thumb { background: #1A1612; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.dark-nav { background: rgba(255,255,255,0.1) !important; }
.dark-hero { background: transparent !important; }
.light-title { background: rgba(255,255,255,0.7) !important; }
.light-sub { background: rgba(255,255,255,0.3) !important; }
.thumb-accent-bar { height: 6px; background: #C84B2F; border-radius: 2px; width: 40%; }

.warm-thumb { background: #FDF6EC; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.warm-nav { background: #E8D5B5 !important; }
.warm-hero { flex-direction: row !important; align-items: center; gap: 6px; }
.thumb-avatar { width: 24px; height: 24px; border-radius: 50%; background: #E8A87C; flex-shrink: 0; }
.warm-title { background: #c9a882 !important; }

.editorial-thumb { background: #F0EDE8; }
.editorial-layout { display: flex; height: 100%; }
.editorial-sidebar { width: 30%; background: #E0D8CC; }
.editorial-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.thumb-block { flex: 1; background: rgba(0,0,0,0.07); border-radius: 3px; }

.glass-thumb { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 8px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.glass-bg { display: flex; flex-direction: column; gap: 6px; }
.glass-card { height: 32px; background: rgba(255,255,255,0.2); border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); }
.sm-card { height: 20px; width: 70%; }

.template-opt-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.template-opt-desc {
  font-size: 0.6875rem;
  color: var(--ink-light);
  text-align: center;
  line-height: 1.4;
}

/* ── Form Navigation ── */
.form-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.btn-back {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.875rem 0;
  transition: var(--transition);
}
.btn-back:hover { color: var(--ink); }

.btn-next, .btn-generate {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 100px;
  padding: 0.875rem 2rem;
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
}
.btn-next:hover, .btn-generate:hover {
  background: var(--accent);
  transform: translateY(-2px);
}
.btn-generate {
  background: var(--accent);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ── Error Messages ── */
.error-msg {
  display: none;
  color: #C0392B;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}
.error-msg.visible { display: block; }

/* ── Success Overlay ── */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,22,18,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.success-overlay.visible { display: flex; }

.success-card {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  max-width: 460px;
  width: 90%;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.success-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.success-card h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.success-card p { color: var(--ink-light); margin-bottom: 1.5rem; }

.portfolio-url {
  background: var(--cream);
  border-radius: 8px;
  padding: 0.875rem 1.25rem;
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 1.5rem;
}

.success-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--accent); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .create-header { padding: 1rem 1.25rem; }
  .create-main { padding: 2rem 1.25rem; }
  .template-selector { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .template-selector { grid-template-columns: repeat(2, 1fr); }
  .image-previews { grid-template-columns: repeat(2, 1fr); }
}

/* ── Deploy hint in success card ── */
.deploy-hint {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink2);
  background: var(--cream);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  line-height: 1.6;
  text-align: left;
}
.deploy-hint strong { color: var(--ink); }
