/* ========================================
   MODAL FORM COMPONENT — Dark glassmorphism
   Self-contained, no base CSS dependency.
   Prefix: .np- (Nice Potolok)
   Used inside .modal-overlay
   ======================================== */

/* Override .modal when it contains .np-form-wrap */
.modal-overlay .np-form-wrap {
  position: relative;
  padding: 40px 36px;
  background: rgba(15,14,12,0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  overflow: hidden;
  max-width: 440px;
  width: 90%;
  margin: 0 auto;
  font-family: 'Golos Text', sans-serif;
  color: var(--color-gray-50);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.5s ease;
  /* Modal animation */
  transform: translateY(20px) scale(0.95);
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}

.modal-overlay .np-form-wrap::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

.modal-overlay.active .np-form-wrap {
  transform: translateY(0) scale(1);
}

/* Animated gradient border */
.np-form-wrap::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 25px;
  padding: 1.5px;
  background: linear-gradient(
    var(--np-border-angle, 0deg),
    rgba(196,180,154,0.4),
    rgba(255,255,255,0.05),
    rgba(140,123,99,0.3),
    rgba(255,255,255,0.05),
    rgba(196,180,154,0.4)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: npBorderRotate 6s linear infinite;
  pointer-events: none;
  z-index: 10;
}

@property --np-border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes npBorderRotate {
  to { --np-border-angle: 360deg; }
}

/* ---- Internal background layers ---- */
.np-bg-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.np-morph-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: 24px;
  pointer-events: none;
}

.np-morph {
  position: absolute;
  filter: blur(30px);
  opacity: 0.3;
  animation: npMorphMove 20s ease-in-out infinite alternate;
}

.np-morph--1 {
  width: 200px; height: 200px;
  top: -40px; left: -30px;
  background: conic-gradient(from 0deg, var(--color-accent), var(--color-primary), #5a4f3e, var(--color-accent));
  border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
  animation-duration: 18s;
}

.np-morph--2 {
  width: 180px; height: 180px;
  bottom: -50px; right: -30px;
  background: conic-gradient(from 180deg, var(--color-primary), var(--color-primary-dark), var(--color-accent), var(--color-primary));
  border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%;
  animation-duration: 22s;
  animation-delay: -6s;
}

.np-morph--3 {
  width: 120px; height: 120px;
  top: 45%; left: 55%;
  background: radial-gradient(circle, rgba(196,180,154,0.5), transparent);
  border-radius: 50%;
  animation-duration: 14s;
  animation-delay: -10s;
}

@keyframes npMorphMove {
  0%   { transform: translate(0,0) rotate(0deg) scale(1);    border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; }
  33%  { transform: translate(20px,-25px) rotate(60deg) scale(1.1);  border-radius: 60% 40% 30% 70% / 40% 60% 40% 60%; }
  66%  { transform: translate(-15px,20px) rotate(120deg) scale(0.95); border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%; }
  100% { transform: translate(10px,-10px) rotate(180deg) scale(1.05); border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%; }
}

/* Inner glow */
.np-inner-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 24px;
  background: radial-gradient(ellipse at center, rgba(196,180,154,0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Content z-index ---- */
.np-form-content {
  position: relative;
  z-index: 5;
}

/* ---- Close button (dark theme) — sticky when scrolling ---- */
.np-form-wrap .np-modal-close {
  position: sticky;
  top: 8px;
  z-index: 15;
  float: right;
  margin: 0 0 -40px 0;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #b0a99c;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.np-form-wrap .np-modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--color-gray-50);
  transform: rotate(90deg);
}

.np-form-wrap .np-modal-close svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ---- Header ---- */
.np-form-head {
  text-align: center;
  margin-bottom: 32px;
}

.np-form-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(196,180,154,0.08);
  border: 1px solid rgba(196,180,154,0.12);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 18px;
}

.np-form-badge .np-live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4caf50;
  animation: npPulse 2s ease-in-out infinite;
}

@keyframes npPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.6); }
}

.np-form-title {
  font-family: 'Lora', serif;
  font-size: 30px;
  font-weight: 400;
  margin: 0 0 6px 0;
  color: var(--color-gray-50);
}

.np-form-sub {
  font-size: 14px;
  color: var(--color-gray-500);
  margin: 0;
}

/* ---- Fields ---- */
.np-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.np-field {
  position: relative;
}

.np-field input,
.np-field textarea {
  width: 100%;
  padding: 20px 18px 10px;
  border: none;
  border-bottom: 1.5px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 12px 12px 0 0;
  font-family: 'Golos Text', sans-serif;
  font-size: 15px;
  color: var(--color-gray-50);
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.np-field textarea {
  resize: none;
  height: 90px;
  padding-top: 26px;
}

.np-field input:focus,
.np-field textarea:focus {
  border-color: var(--color-accent);
  background: rgba(255,255,255,0.04);
}

.np-field label {
  position: absolute;
  left: 18px;
  top: 16px;
  font-size: 14px;
  color: var(--color-gray-500);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: left;
}

.np-field input:focus ~ label,
.np-field input:not(:placeholder-shown) ~ label,
.np-field textarea:focus ~ label,
.np-field textarea:not(:placeholder-shown) ~ label {
  top: 4px;
  font-size: 10px;
  color: var(--color-accent);
  letter-spacing: 0.5px;
}

.np-field .np-glow {
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border-radius: 1px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(196,180,154,0.3);
}

.np-field input:focus ~ .np-glow,
.np-field textarea:focus ~ .np-glow {
  width: 100%;
}

/* ---- Checkbox ---- */
.np-cb {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.np-cb input { display: none; }

.np-cb-box {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-top: 1px;
}

.np-cb input:checked ~ .np-cb-box {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.np-cb-box svg {
  width: 12px; height: 12px;
  stroke: #0f0e0c;
  stroke-width: 3; fill: none;
  opacity: 0; transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.np-cb input:checked ~ .np-cb-box svg {
  opacity: 1;
  transform: scale(1);
}

.np-cb-label {
  font-size: 12px;
  color: var(--color-gray-500);
  line-height: 1.5;
}

.np-cb-label a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(196,180,154,0.3);
}

/* ---- Submit ---- */
.np-submit {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: #0f0e0c;
  font-family: 'Golos Text', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 6px 24px rgba(196,180,154,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.np-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(196,180,154,0.3);
}

.np-submit::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.np-submit:hover::after { left: 120%; }

.np-submit svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  stroke-width: 2; fill: none;
  transition: transform 0.3s ease;
}

.np-submit:hover svg { transform: translateX(4px); }

/* ---- Trust ---- */
.np-trust {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.np-trust span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--color-gray-500);
}

.np-trust svg {
  width: 12px; height: 12px;
  stroke: var(--color-accent);
  stroke-width: 1.5; fill: none;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .modal-overlay .np-form-wrap {
    padding: 28px 22px;
    border-radius: 20px;
  }
  .np-form-wrap::before { border-radius: 21px; }
  .np-trust { flex-direction: column; align-items: center; gap: 8px; }
}

/* === Success state === */
.np-form-success {
  text-align: center;
  padding: 48px 24px;
  animation: npFadeIn 0.4s ease;
}
.np-success-icon {
  margin-bottom: 16px;
}
.np-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}
.np-success-text {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}
@keyframes npFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Field error state === */
.np-field-error {
  border-color: #ff4444 !important;
  box-shadow: 0 0 0 2px rgba(255,68,68,0.2);
}

/* === Validation hint message === */
.np-field-hint {
  display: block;
  font-size: 0.8rem;
  color: #ff6b6b;
  margin-top: 4px;
  padding-left: 2px;
  animation: npFadeIn 0.2s ease;
}
