/* ═══════════════════════════════════════════════════
   MitchMarket Marketplace — Common Styles
   ═══════════════════════════════════════════════════ */

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

:root {
  --primary: #092053;
  --primary-deep: #050e2b;
  --secondary: #31FFFF;
  --accent: #6366f1;
  --glow: rgba(49, 255, 255, .15);
  --text: #eef2ff;
  --text-dim: rgba(141, 162, 201, .7);
  --glass: rgba(9, 32, 83, .35);
  --border: rgba(49, 255, 255, .07);
  --danger: #ff4d6a;
  --success: #34d399;
  /* Background — soft “aurora” (desaturated glows read more premium than raw #31FFFF) */
  --bg-base: #050c18;
  --bg-ink: #030810;
}

html, body { height: 100%; }

html {
  background: var(--bg-ink);
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-base);
  /* Fewer layers: one diagonal base + two large soft lights */
  background-image:
    radial-gradient(ellipse 100% 85% at 88% -5%, rgba(160, 230, 245, 0.16) 0%, transparent 48%),
    radial-gradient(ellipse 90% 70% at -5% 105%, rgba(9, 32, 83, 0.55) 0%, transparent 52%),
    linear-gradient(162deg, #0c1830 0%, #081020 38%, #050c18 72%, var(--bg-ink) 100%);
  background-attachment: fixed;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
}

/* ── Particle Canvas ── */
canvas#particles { position: fixed; inset: 0; z-index: 0; }

/* ── Noise Overlay ── */
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .018;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── Cursor Glow ── */
.cursor-glow {
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(49,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity .4s;
  opacity: 0;
}
.cursor-glow.active { opacity: 1; }

/* ═══════ SCENE LAYOUT ═══════ */
.scene {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(1060px, 94vw);
  min-height: min(640px, 90vh);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(49,255,255,.04),
    0 40px 80px -20px rgba(0,0,0,.6),
    0 0 120px -40px rgba(49,255,255,.1);
  animation: sceneIn .9s cubic-bezier(.22, 1, .36, 1) both;
  perspective: 1200px;
}
@keyframes sceneIn {
  from { opacity: 0; transform: scale(.94) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════ HERO PANEL (LEFT) ═══════ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem;
  background: linear-gradient(155deg, rgba(12,28,72,.88) 0%, rgba(5,12,28,.94) 100%);
  overflow: hidden;
}

.hero-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 22% 28%, rgba(130, 220, 235, .12) 0%, transparent 58%),
    radial-gradient(ellipse at 78% 72%, rgba(9, 32, 83, .35) 0%, transparent 55%);
  animation: meshShift 14s ease-in-out infinite alternate;
}
@keyframes meshShift {
  0%   { opacity: .88; }
  100% { opacity: 1; }
}

.hero-rings {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.hero-rings .ring {
  position: absolute;
  border: 1px solid rgba(49,255,255,.06);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ringPulse 6s ease-in-out infinite;
}
.hero-rings .ring:nth-child(1) { width: 200px; height: 200px; animation-delay: 0s; }
.hero-rings .ring:nth-child(2) { width: 340px; height: 340px; animation-delay: -1.5s; }
.hero-rings .ring:nth-child(3) { width: 480px; height: 480px; animation-delay: -3s; }
.hero-rings .ring:nth-child(4) { width: 620px; height: 620px; animation-delay: -4.5s; }
@keyframes ringPulse {
  0%, 100% { opacity: .3; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: .7; transform: translate(-50%, -50%) scale(1.04); }
}

.hero-logo {
  position: relative; z-index: 1;
  width: 256px; height: 56px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 24px rgba(49,255,255,.3));
}

.hero-content { position: relative; z-index: 1; }
.hero-content h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.hero-content h2 span { color: var(--secondary); }
.hero-content p {
  font-size: .9rem;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.6;
  max-width: 320px;
}

.hero-badges {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-top: 1.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: 100px;
  background: rgba(49,255,255,.06);
  border: 1px solid rgba(49,255,255,.1);
  color: var(--secondary);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .03em;
  backdrop-filter: blur(8px);
}
.badge .dot {
  width: 5px; height: 5px;
  background: var(--secondary);
  border-radius: 50%;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .3; }
}

/* ═══════ FORM PANEL (RIGHT) ═══════ */
.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2.75rem;
  background: rgba(7, 18, 48, .85);
  backdrop-filter: blur(60px) saturate(1.2);
  -webkit-backdrop-filter: blur(60px) saturate(1.2);
}

.form-panel-scroll {
  overflow-y: auto;
  max-height: 90vh;
  padding-right: .5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(49,255,255,.15) transparent;
}
.form-panel-scroll::-webkit-scrollbar { width: 4px; }
.form-panel-scroll::-webkit-scrollbar-track { background: transparent; }
.form-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(49,255,255,.15);
  border-radius: 4px;
}

.form-header { margin-bottom: 2rem; }
.form-header .greeting {
  font-size: .82rem;
  color: var(--secondary);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.form-header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.015em;
}
.form-header .subtitle {
  font-size: .85rem;
  color: var(--text-dim);
  margin-top: .35rem;
  font-weight: 300;
}

/* ═══════ FLOATING-LABEL FIELD ═══════ */
.field {
  position: relative;
  margin-bottom: 1.5rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 1.1rem 0 .55rem;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(49,255,255,.1);
  color: var(--text);
  font-family: 'Roboto', sans-serif;
  font-size: .95rem;
  outline: none;
  transition: border-color .3s;
}
.field select { cursor: pointer; }
.field select option { background: var(--primary); color: var(--text); }
.field textarea { resize: vertical; min-height: 60px; }

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--secondary); }

.field input::placeholder,
.field textarea::placeholder { color: transparent; }

.field label {
  position: absolute;
  left: 0; top: 1rem;
  font-size: .92rem;
  color: var(--text-dim);
  pointer-events: none;
  transition: .25s cubic-bezier(.4, 0, .2, 1);
  transform-origin: left;
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field textarea:focus ~ label,
.field textarea:not(:placeholder-shown) ~ label,
.field select:focus ~ label,
.field select.has-value ~ label,
.field .label-static {
  top: 0;
  font-size: .7rem;
  color: var(--primary);
  letter-spacing: .06em;
  font-weight: 500;
}

.field .underline {
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  border-radius: 2px;
  transition: width .35s cubic-bezier(.4, 0, .2, 1), left .35s cubic-bezier(.4, 0, .2, 1);
}
.field input:focus ~ .underline,
.field select:focus ~ .underline,
.field textarea:focus ~ .underline {
  width: 100%; left: 0;
}

.field .icon-right {
  position: absolute;
  right: 0; top: .85rem;
  background: none; border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  transition: color .3s;
}
.field .icon-right:hover { color: var(--secondary); }
.field .icon-right svg { width: 18px; height: 18px; display: block; }

.field .field-hint {
  font-size: .72rem;
  color: var(--text-dim);
  margin-top: .35rem;
}
.field .field-error {
  font-size: .72rem;
  color: var(--danger);
  margin-top: .35rem;
  display: none;
}

/* ═══════ FORM ROW (side by side) ═══════ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

/* ═══════ BUTTONS ═══════ */
.btn-glow {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  font-family: 'Roboto', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  color: var(--primary-deep);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--secondary), #00d4d4, var(--accent));
  background-size: 200% 200%;
  animation: gradientMove 4s ease infinite;
  box-shadow: 0 4px 24px rgba(49,255,255,.2);
  transition: transform .25s, box-shadow .25s;
}
@keyframes gradientMove {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(49,255,255,.3);
}
.btn-glow:active { transform: translateY(0); }
.btn-glow:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-glow .btn-label {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-glow .btn-label svg { width: 18px; height: 18px; transition: transform .3s; }
.btn-glow:hover .btn-label svg { transform: translateX(4px); }

.btn-glow .spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(5,14,43,.2);
  border-top-color: var(--primary-deep);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.btn-glow.loading .btn-label { display: none; }
.btn-glow.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-outline {
  width: 100%;
  padding: .85rem;
  border: 1.5px solid rgba(49,255,255,.15);
  border-radius: 12px;
  font-family: 'Roboto', sans-serif;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .03em;
  cursor: pointer;
  color: var(--secondary);
  background: transparent;
  transition: .3s;
}
.btn-outline:hover {
  border-color: var(--secondary);
  background: rgba(49,255,255,.05);
  transform: translateY(-1px);
}

/* ═══════ DIVIDER ═══════ */
.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0;
  font-size: .75rem;
  color: var(--text-dim);
  letter-spacing: .06em;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(49,255,255,.08);
}

/* ═══════ FORM FOOTER ═══════ */
.form-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: .84rem;
  color: var(--text-dim);
}
.form-footer a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  transition: .3s;
}
.form-footer a:hover { text-shadow: 0 0 10px var(--glow); }

/* ═══════ BACK LINK ═══════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .3s;
  margin-bottom: 1.5rem;
}
.back-link svg { width: 16px; height: 16px; transition: transform .3s; }
.back-link:hover { color: var(--secondary); }
.back-link:hover svg { transform: translateX(-3px); }

/* ═══════ ALERT BOX ═══════ */
.alert {
  padding: .85rem 1rem;
  border-radius: 10px;
  font-size: .82rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  display: none;
}
.alert.alert-success {
  background: rgba(52, 211, 153, .08);
  border: 1px solid rgba(52, 211, 153, .2);
  color: var(--success);
}
.alert.alert-error {
  background: rgba(255, 77, 106, .08);
  border: 1px solid rgba(255, 77, 106, .2);
  color: var(--danger);
}
.alert.show { display: block; }

/* ═══════ CHECKBOX ═══════ */
.check-wrap {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text-dim);
  user-select: none;
  margin-bottom: 1.5rem;
}
.check-wrap input[type="checkbox"] { display: none; }
.check-box {
  width: 18px; height: 18px;
  flex-shrink: 0;
  border: 1.5px solid rgba(49,255,255,.25);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .3s;
  margin-top: 1px;
}
.check-box svg {
  width: 12px; height: 12px;
  color: var(--primary);
  opacity: 0;
  transform: scale(.5);
  transition: .3s;
}
.check-wrap input:checked + .check-box {
  background: var(--secondary);
  border-color: var(--secondary);
}
.check-wrap input:checked + .check-box svg {
  opacity: 1; transform: scale(1);
}
.check-wrap a {
  color: var(--secondary);
  text-decoration: none;
}
.check-wrap a:hover { text-decoration: underline; }

/* ═══════ REVEAL ANIMATIONS ═══════ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: revealUp .6s cubic-bezier(.22, 1, .36, 1) forwards;
}
.reveal.d1 { animation-delay: .15s; }
.reveal.d2 { animation-delay: .25s; }
.reveal.d3 { animation-delay: .35s; }
.reveal.d4 { animation-delay: .45s; }
.reveal.d5 { animation-delay: .55s; }
.reveal.d6 { animation-delay: .65s; }
.reveal.d7 { animation-delay: .75s; }
.reveal.d8 { animation-delay: .85s; }
.reveal.d9 { animation-delay: .95s; }
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 768px) {
  .scene {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: auto;
  }
  .hero { display: none; }
  .form-panel { padding: 2.5rem 1.75rem 2rem; }
  .form-panel::before {
    content: '';
    display: block;
    width: 48px; height: 48px;
    background: url('../../../MitchMarket_logo.png') center/contain no-repeat;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 0 16px rgba(49,255,255,.3));
  }
  .form-row { grid-template-columns: 1fr; }
}
