/* Contact — Signal Relay (asymmetric card canvas + floating form panel) */

.page-contact-relay .page-main {
  padding-top: 0;
  background: #eef1f5;
}

/* ── Ribbon ── */
.a55-relay-ribbon {
  padding: clamp(20px, 3.5vw, 32px) 0;
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(147, 197, 253, 0.2), transparent 55%),
    linear-gradient(128deg, #0f172a 0%, #1e3a5f 48%, #0a3d62 100%);
  color: #e8f0f8;
  position: relative;
  overflow: clip;
}

.a55-relay-ribbon::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(31, 107, 74, 0.2), transparent 40%);
  pointer-events: none;
}

.a55-relay-ribbon-inner {
  position: relative;
  z-index: 1;
}

.a55-relay-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.88);
}

.a55-relay-crumb a {
  color: rgba(232, 240, 248, 0.88);
  text-decoration: none;
}

.a55-relay-crumb a:hover { color: #fff; }

.a55-relay-crumb [aria-current="page"] { color: #fff; }

.a55-relay-ribbon-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.a55-relay-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 240, 248, 0.72);
}

.a55-relay-kicker span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(31, 107, 74, 0.9);
  color: #fff;
  font-size: 0.6rem;
}

.a55-relay-ribbon h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.a55-relay-dek {
  margin: 0;
  max-width: 48ch;
  font-size: 0.96rem;
  line-height: 1.65;
  color: rgba(232, 240, 248, 0.68);
}

.a55-relay-pulse {
  display: flex;
  gap: 10px;
  align-items: center;
}

.a55-relay-pulse span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(147, 197, 253, 0.35);
  animation: a55-relay-pulse 1.8s ease-in-out infinite;
}

.a55-relay-pulse span:nth-child(2) { animation-delay: 0.3s; }
.a55-relay-pulse span:nth-child(3) { animation-delay: 0.6s; background: var(--success); opacity: 0.7; }

@keyframes a55-relay-pulse {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.35); opacity: 1; }
}

/* ── Asymmetric canvas grid ── */
.a55-relay-canvas {
  padding: clamp(24px, 4vw, 40px) 0 clamp(56px, 8vw, 80px);
}

.a55-relay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(180px, 1fr));
  grid-template-areas:
    "form email phone"
    "form hours address"
    "form gstin address"
    "chips chips chips";
  gap: clamp(12px, 2vw, 16px);
  align-items: stretch;
}

.a55-relay-panel-form { grid-area: form; }
.a55-relay-card-email { grid-area: email; }
.a55-relay-card-phone { grid-area: phone; }
.a55-relay-card-hours { grid-area: hours; }
.a55-relay-card-address { grid-area: address; }
.a55-relay-card-gstin { grid-area: gstin; }
.a55-relay-chips { grid-area: chips; }

/* Adjust grid when optional cards missing — use auto placement fallback */
.a55-relay-grid:not(:has(.a55-relay-card-email)) {
  grid-template-areas:
    "form phone phone"
    "form hours address"
    "form gstin address"
    "chips chips chips";
}

.a55-relay-grid:not(:has(.a55-relay-card-hours)) {
  grid-template-areas:
    "form email phone"
    "form address address"
    "form gstin gstin"
    "chips chips chips";
}

/* ── Form panel ── */
.a55-relay-panel {
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--radius-xl);
  background: var(--paper);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.a55-relay-panel:hover {
  box-shadow:
    0 28px 60px rgba(10, 61, 98, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.a55-relay-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(18px, 2.5vw, 22px);
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.a55-relay-panel-head h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 800;
  color: var(--ink);
}

.a55-relay-panel-head p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--graphite);
}

.a55-relay-panel-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(10, 61, 98, 0.1), rgba(31, 107, 74, 0.08));
  font-size: 1.2rem;
}

/* Flash notices */
.a55-relay-flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
}

.a55-relay-flash-err {
  background: rgba(200, 29, 37, 0.08);
  border: 1px solid rgba(200, 29, 37, 0.22);
  color: var(--signal-deep);
  animation: a55-relay-shake 0.45s ease;
}

.a55-relay-flash-ok {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(31, 107, 74, 0.08);
  border: 1px solid rgba(31, 107, 74, 0.2);
  color: var(--success);
}

.a55-relay-flash-ok svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.a55-relay-flash-ok strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.a55-relay-flash-ok p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--graphite);
}

@keyframes a55-relay-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Form fields */
.a55-relay-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.a55-relay-form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.a55-relay-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.a55-relay-field-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}

.a55-relay-field-label small {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  opacity: 0.8;
}

.a55-relay-field input,
.a55-relay-field textarea {
  width: 100%;
  padding: 12px 0 10px;
  border: 0;
  border-bottom: 2px solid rgba(15, 23, 42, 0.12);
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.25s ease;
}

.a55-relay-field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.55;
}

.a55-relay-field-line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--blueprint), var(--success));
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.a55-relay-field.is-focus .a55-relay-field-label {
  color: var(--blueprint);
}

.a55-relay-field.is-focus .a55-relay-field-line {
  width: 100%;
}

.a55-relay-field.is-focus input,
.a55-relay-field.is-focus textarea {
  border-bottom-color: transparent;
}

.a55-relay-field.is-valid .a55-relay-field-line {
  width: 100%;
  background: var(--success);
}

.a55-relay-field.is-valid .a55-relay-field-label::after {
  content: " ✓";
  color: var(--success);
}

.a55-relay-field.is-invalid input,
.a55-relay-field.is-invalid textarea {
  border-bottom-color: var(--signal);
}

.a55-relay-field.is-invalid .a55-relay-field-line {
  width: 100%;
  background: var(--signal);
}

.a55-relay-field-hint {
  min-height: 1em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--signal);
}

.a55-relay-send {
  position: relative;
  overflow: hidden;
  align-self: flex-start;
  margin-top: 4px;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--blueprint), var(--blueprint-deep));
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(10, 61, 98, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.a55-relay-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(10, 61, 98, 0.34);
}

.a55-relay-send-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: a55-relay-shimmer 3s ease-in-out infinite;
}

@keyframes a55-relay-shimmer {
  0%, 70%, 100% { transform: translateX(-100%); }
  85% { transform: translateX(100%); }
}

/* ── Info cards ── */
.a55-relay-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: clamp(16px, 2.2vw, 20px);
  border-radius: var(--radius-xl);
  background: var(--paper);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: var(--shadow-xs);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.a55-relay-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 0 16px 40px rgba(10, 61, 98, 0.1);
  border-color: rgba(10, 61, 98, 0.14);
}

.a55-relay-card-email:hover { transform: translateY(-6px) rotate(0.8deg); }
.a55-relay-card-phone:hover { transform: translateY(-6px) rotate(-0.8deg); }
.a55-relay-card-hours:hover { transform: translateY(-6px) rotate(0.5deg); }
.a55-relay-card-address:hover { transform: translateY(-4px); }
.a55-relay-card-gstin:hover { transform: translateY(-6px) rotate(-1deg); }

.a55-relay-card-glyph {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: rgba(10, 61, 98, 0.08);
  font-size: 1rem;
  color: var(--blueprint);
}

.a55-relay-card > p {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.a55-relay-card strong,
.a55-relay-card a {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}

.a55-relay-card a {
  text-decoration: none;
  color: var(--blueprint);
}

.a55-relay-card a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.a55-relay-card small {
  margin-top: 4px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--graphite);
}

.a55-relay-card-address {
  background:
    linear-gradient(145deg, rgba(10, 61, 98, 0.04), transparent),
    var(--paper);
}

/* Quick link chips */
.a55-relay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: clamp(14px, 2vw, 18px);
  border-radius: var(--radius-xl);
  background: rgba(15, 23, 42, 0.03);
  border: 1px dashed rgba(15, 23, 42, 0.12);
}

.a55-relay-chips a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--paper);
  border: 1px solid rgba(15, 23, 42, 0.1);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blueprint);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.a55-relay-chips a:hover {
  background: var(--blueprint);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(10, 61, 98, 0.22);
}

/* Entrance */
.a55-relay-animate {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.a55-relay-animate.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .a55-relay-grid,
  .a55-relay-grid:not(:has(.a55-relay-card-email)),
  .a55-relay-grid:not(:has(.a55-relay-card-hours)) {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "form form"
      "email phone"
      "hours gstin"
      "address address"
      "chips chips";
  }
}

@media (max-width: 600px) {
  .a55-relay-grid,
  .a55-relay-grid:not(:has(.a55-relay-card-email)),
  .a55-relay-grid:not(:has(.a55-relay-card-hours)) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "email"
      "phone"
      "hours"
      "address"
      "gstin"
      "chips";
  }

  .a55-relay-form-split {
    grid-template-columns: 1fr;
  }

  .a55-relay-send {
    width: 100%;
  }

  .a55-relay-card:hover {
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .a55-relay-pulse span,
  .a55-relay-flash-err,
  .a55-relay-send-glow,
  .a55-relay-animate,
  .a55-relay-card {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}
