/* ═══════════════════════════════════════════════════════
   contact.css — Rainwire Contact Modal
   Enhanced · Fully Responsive · Production-Ready
═══════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --cp:           #2563eb;
  --cp-dk:        #1d4ed8;
  --cp-xdk:       #1e40af;
  --cp-lt:        #eff6ff;
  --cp-ring:      rgba(37, 99, 235, 0.15);
  --cp-glow:      rgba(37, 99, 235, 0.25);
  --ce:           #dc2626;
  --ce-lt:        rgba(220, 38, 38, 0.10);
  --cb:           #e2e8f0;
  --cb-dk:        #cbd5e1;
  --ct:           #0f172a;
  --ct-2:         #1e293b;
  --cm:           #64748b;
  --cm-lt:        #94a3b8;
  --cw:           #ffffff;
  --cs:           #f8fafc;
  --c-success:    #059669;
  --c-success-lt: rgba(5, 150, 105, 0.10);

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   22px;
  --r-2xl:  28px;

  --shadow-panel:  0 32px 80px rgba(0, 0, 0, 0.20), 0 8px 24px rgba(37, 99, 235, 0.10);
  --shadow-input:  0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-btn:    0 4px 20px rgba(37, 99, 235, 0.30);
  --shadow-btn-hv: 0 10px 32px rgba(37, 99, 235, 0.42);

  --spring:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:  cubic-bezier(0, 0, 0.3, 1);

  --fd:  'Syne', sans-serif;
  --fb:  'DM Sans', sans-serif;
}

/* ══════════════════════════════════════════
   OVERLAY
══════════════════════════════════════════ */
.cm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 13, 37, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.30s ease;
}

.cm-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ══════════════════════════════════════════
   PANEL
══════════════════════════════════════════ */
.cm-panel {
  display: flex;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  background: var(--cw);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  transform: translateY(32px) scale(0.96);
  transition: transform 0.42s var(--spring);
  position: relative;
}

.cm-overlay.is-open .cm-panel {
  transform: translateY(0) scale(1);
}

/* ══════════════════════════════════════════
   SIDE STRIP
══════════════════════════════════════════ */
.cm-strip {
  width: 88px;
  flex-shrink: 0;
  background: linear-gradient(175deg, #2563eb 0%, #1e3a8a 55%, #0c1838 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.cm-strip::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 160px; height: 160px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.cm-strip::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 110px; height: 110px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

/* Grid pattern overlay on strip */
.cm-strip-grid {
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.3' stroke-opacity='0.12'%3E%3Cpath d='M0 10h20M10 0v20'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.cm-strip__logo {
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: background 0.2s, border-color 0.2s;
}

.cm-strip__logo:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.cm-strip__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.cm-strip__label {
  font-family: var(--fd);
  font-size: 9px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  position: relative;
  z-index: 1;
  line-height: 1;
}

.cm-strip__dots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.cm-strip__dots i {
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-style: normal;
}

.cm-strip__dots i:first-child {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* ══════════════════════════════════════════
   BODY
══════════════════════════════════════════ */
.cm-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #dbeafe #f1f5f9;
}

.cm-body::-webkit-scrollbar { width: 4px; }
.cm-body::-webkit-scrollbar-track { background: #f1f5f9; }
.cm-body::-webkit-scrollbar-thumb { background: #bfdbfe; border-radius: 4px; }
.cm-body::-webkit-scrollbar-thumb:hover { background: var(--cp); }

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.cm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-shrink: 0;
}

/* Tag pill */
.cm-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--fd);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp);
  background: var(--cp-lt);
  border: 1px solid rgba(37, 99, 235, 0.18);
  padding: 5px 13px;
  border-radius: 100px;
  margin-bottom: 0.65rem;
}

.cm-tag svg {
  animation: dotPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.6); }
}

/* Title */
.cm-title {
  font-family: var(--fd);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 800;
  color: var(--ct);
  line-height: 1.15;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}

.cm-title span {
  color: var(--cp);
  position: relative;
}

.cm-sub {
  font-family: var(--fb);
  font-size: 0.81rem;
  color: var(--cm);
  margin: 0;
  line-height: 1.5;
}

/* Close button */
.cm-close {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border: 1.5px solid var(--cb);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--cm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}

.cm-close:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  transform: rotate(90deg);
}

.cm-close:focus-visible {
  outline: 2px solid var(--cp);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════
   FORM
══════════════════════════════════════════ */
.cm-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.cm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Field ── */
.cm-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cm-field--full {
  grid-column: 1 / -1;
}

.cm-field label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--fd);
  font-size: 0.7rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}

.cm-field label svg {
  color: var(--cp);
  flex-shrink: 0;
  opacity: 0.8;
}

.cm-field label em {
  color: var(--ce);
  font-style: normal;
  margin-left: 1px;
}

/* ── Inputs & Textarea ── */
.cm-field input,
.cm-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--cs);
  border: 1.5px solid var(--cb);
  border-radius: var(--r-md);
  padding: 0.7rem 0.95rem;
  font-family: var(--fb);
  font-size: 0.875rem;
  color: var(--ct);
  line-height: 1.5;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow-input);
  transition: border-color 0.20s, box-shadow 0.20s, background 0.20s;
}

.cm-field input::placeholder,
.cm-field textarea::placeholder {
  color: #b8c4d4;
}

.cm-field input:hover:not(:focus):not(.is-err),
.cm-field textarea:hover:not(:focus):not(.is-err) {
  border-color: var(--cb-dk);
}

.cm-field input:focus,
.cm-field textarea:focus {
  border-color: var(--cp);
  background: var(--cw);
  box-shadow: 0 0 0 3.5px var(--cp-ring), var(--shadow-input);
}

/* Error state */
.cm-field input.is-err,
.cm-field textarea.is-err,
.cm-field .cm-select-wrap select.is-err {
  border-color: var(--ce);
  box-shadow: 0 0 0 3px var(--ce-lt);
  background: #fff5f5;
}

.cm-field textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 220px;
}

/* ── Select ── */
.cm-select-wrap {
  position: relative;
}

.cm-select-wrap select {
  width: 100%;
  box-sizing: border-box;
  background: var(--cs);
  border: 1.5px solid var(--cb);
  border-radius: var(--r-md);
  padding: 0.7rem 2.5rem 0.7rem 0.95rem;
  font-family: var(--fb);
  font-size: 0.875rem;
  color: var(--ct);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: var(--shadow-input);
  transition: border-color 0.20s, box-shadow 0.20s, background 0.20s;
}

.cm-select-wrap select:hover:not(:focus) {
  border-color: var(--cb-dk);
}

.cm-select-wrap select:focus {
  border-color: var(--cp);
  background: var(--cw);
  box-shadow: 0 0 0 3.5px var(--cp-ring), var(--shadow-input);
}

.cm-select-wrap select option {
  font-family: var(--fb);
  color: var(--ct);
}

.cm-select-wrap select optgroup {
  font-family: var(--fd);
  font-weight: 700;
  color: var(--cm);
}

.cm-chevron {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.18s, transform 0.22s var(--spring);
}

.cm-select-wrap:focus-within .cm-chevron {
  color: var(--cp);
  transform: translateY(-50%) rotate(180deg);
}

/* ── Char counter ── */
.cm-char {
  font-family: var(--fb);
  font-size: 0.68rem;
  color: var(--cm-lt);
  text-align: right;
  margin-top: 0.15rem;
  transition: color 0.18s;
}

.cm-char.warn { color: #f59e0b; }
.cm-char.danger { color: var(--ce); font-weight: 600; }

/* ── Error message ── */
.cm-err {
  font-family: var(--fb);
  font-size: 0.7rem;
  color: var(--ce);
  min-height: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}

.cm-err:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  background: var(--ce);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   ACTIONS BAR
══════════════════════════════════════════ */
.cm-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1.1rem;
  margin-top: 0.25rem;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

/* ── Buttons ── */
.cm-btn {
  font-family: var(--fd);
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--r-md);
  padding: 0.7rem 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  transition: transform 0.22s var(--spring),
              box-shadow 0.22s ease,
              background 0.18s,
              color 0.18s,
              border-color 0.18s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.cm-btn:focus-visible {
  outline: 2px solid var(--cp);
  outline-offset: 2px;
}

/* Ghost */
.cm-btn--ghost {
  background: transparent;
  color: var(--cm);
  border: 1.5px solid var(--cb);
}

.cm-btn--ghost:hover {
  background: var(--cs);
  color: var(--ct-2);
  border-color: #94a3b8;
}

.cm-btn--ghost:active { transform: scale(0.97); }

/* Primary */
.cm-btn--primary {
  background: linear-gradient(130deg, var(--cp) 0%, var(--cp-xdk) 100%);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-btn);
  letter-spacing: 0.01em;
}

/* Shimmer on hover */
.cm-btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 0.52s ease;
  pointer-events: none;
}

.cm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hv);
}

.cm-btn--primary:hover::after {
  transform: translateX(120%);
}

.cm-btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-btn);
}

.cm-btn--primary:disabled {
  opacity: 0.60;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading state */
.cm-btn.is-loading .btn-label::after {
  content: '';
  display: inline-block;
  width: 13px; height: 13px;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cfSpin 0.65s linear infinite;
}

.cm-btn.is-loading .btn-ico { display: none; }

@keyframes cfSpin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   SUCCESS STATE
══════════════════════════════════════════ */
.cm-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.75rem 1.5rem;
  flex: 1;
  gap: 0.65rem;
  animation: successFadeIn 0.45s var(--spring) forwards;
}

.cm-success.is-visible { display: flex; }

@keyframes successFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Animated ring */
.cm-success__ring {
  width: 76px; height: 76px;
  margin-bottom: 0.85rem;
}

.cm-success__ring svg {
  width: 76px; height: 76px;
}

.ring-track {
  stroke: #e2e8f0;
  stroke-width: 2.5;
}

.ring-fill {
  stroke: var(--cp);
  stroke-width: 2.5;
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  transform-origin: center;
  transform: rotate(-90deg);
  animation: ringDraw 0.65s ease forwards 0.1s;
}

.ring-tick {
  stroke: var(--cp);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: tickDraw 0.38s ease forwards 0.68s;
}

@keyframes ringDraw { to { stroke-dashoffset: 0; } }
@keyframes tickDraw { to { stroke-dashoffset: 0; } }

.cm-success h3 {
  font-family: var(--fd);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ct);
  margin: 0;
  letter-spacing: -0.01em;
}

.cm-success p {
  font-family: var(--fb);
  font-size: 0.875rem;
  color: var(--cm);
  max-width: 320px;
  line-height: 1.7;
  margin: 0;
}

.cm-success strong { color: var(--cp); font-weight: 700; }

.cm-success .cm-btn {
  margin-top: 0.85rem;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* Tablet — tighten spacing */
@media (max-width: 720px) {
  .cm-panel {
    max-height: 94vh;
    border-radius: var(--r-xl);
  }

  .cm-strip {
    width: 72px;
  }

  .cm-body {
    padding: 1.6rem 1.5rem;
  }

  .cm-title {
    font-size: 1.3rem;
  }
}

/* Mobile — single column, hide strip */
@media (max-width: 560px) {
  .cm-overlay {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .cm-panel {
    max-height: 96vh;
    border-radius: var(--r-xl) var(--r-xl) var(--r-lg) var(--r-lg);
    transform: translateY(48px) scale(0.98);
  }

  .cm-overlay.is-open .cm-panel {
    transform: translateY(0) scale(1);
  }

  .cm-strip {
    display: none;
  }

  .cm-body {
    padding: 1.5rem 1.2rem 1.25rem;
  }

  .cm-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .cm-field--full {
    grid-column: 1;
  }

  .cm-header {
    margin-bottom: 1.4rem;
  }

  .cm-title {
    font-size: 1.2rem;
  }

  .cm-actions {
    flex-direction: column-reverse;
    gap: 0.6rem;





























































  }

  .cm-btn {
    width: 100%;
    justify-content: center;
    padding: 0.78rem 1.5rem;
  }

  .cm-success {
    padding: 2rem 1rem;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .cm-body { padding: 1.2rem 1rem; }
  .cm-title { font-size: 1.1rem; }
  .cm-field input,
  .cm-field textarea,
  .cm-select-wrap select { font-size: 0.8rem; }
}

/* ══════════════════════════════════════════
   ACCESSIBILITY
══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .cm-panel,
  .cm-overlay,
  .cm-btn,
  .cm-close,
  .cm-success { transition-duration: 0.01ms !important; }

  .ring-fill,
  .ring-tick,
  .cm-tag svg,
  .cm-btn--primary::after,
  .cm-btn.is-loading .btn-label::after { animation-duration: 0.01ms !important; }
}