/* ============================================================
   Contact Page
   Inputs/labels/buttons are inherited from base_auth.css.
   A floating info card overlapping a glass form sheet. All
   colors are derived from the project's own brand vars
   (--primary-blue/--accent-blue) via color-mix(), so this
   auto-adapts per project instead of a fixed hue.
   ============================================================ */

/* ── Outer wrapper ───────────────────────────────────────── */

body:has(.contact-page) main {
  padding: 0 !important;
  overflow: hidden;
}

.contact-page {
  padding: clamp(28px, 4vw, 56px) clamp(16px, 4vw, 48px) clamp(48px, 6vw, 88px);
}

@media (prefers-reduced-motion: reduce) {
  .contact-form-orb {
    animation: none;
  }
}

/* Alert banners (toggled by JS on submit) */
.contact-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-medium);
  /* !important: some projects globally zero out margins with their own
     !important reset (e.g. eduloo's `:where(body) :where(...) { margin: 0
     !important }`), which would otherwise silently eat this layout-critical
     spacing. */
  margin: 0 0 20px !important;
  font-size: 14px;
  line-height: 1.5;
}

.contact-alert i {
  flex-shrink: 0;
  margin-top: 2px !important;
}

/* Semantic success/error states - intentionally NOT brand-derived: these are
   fixed status colors, not accent chrome. A red-branded project's error alert
   must not become red-on-red. */
.contact-alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #16a34a;
}

body.theme-dark .contact-alert-success {
  color: #4ade80;
}

.contact-alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

body.theme-dark .contact-alert-danger {
  color: #f87171;
}

/* ── Bottom: floating info card + glass form sheet ───────── */

.contact-bottom {
  position: relative;
}

/* Floating "Contact Info" card - a colored glass panel that overlaps the
   left edge of the form sheet next to it. Collapses to a normal stacked
   block above the sheet under 1000px (see media query below). */
.contact-info-panel {
  position: absolute;
  left: clamp(24px, 3vw, 48px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(260px, 24vw, 320px);
  z-index: 2;
  border-radius: 24px;
  padding: clamp(24px, 3vw, 32px) clamp(20px, 2.4vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--primary-blue) 92%, black) 0%,
    color-mix(in srgb, var(--primary-blue) 74%, black) 100%
  );
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 30px 60px -24px color-mix(in srgb, var(--primary-blue) 50%, black),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.contact-info-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-info-title {
  font-family: 'Plus Jakarta Sans', var(--font, inherit);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  margin: 0;
}

.contact-info-subtitle {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-info-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Colored icon circle */
/* Plain fill, no border/inset ring - the icon glyph itself already reads
   as its own shape, an extra CSS border around it just doubled up. */
.contact-info-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 15px;
}

.contact-info-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.contact-info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.75);
}

.contact-info-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.5;
  word-break: break-word;
}

.contact-social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: auto !important;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.contact-social-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.56px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.contact-social-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* .footer-social is reused as-is for the icon buttons; on this dark glass
   card it needs a lighter base treatment than its default (muted-text-tinted)
   look, since it sits on a solid brand-color background, not the page bg. */
.contact-social-row .footer-social {
  width: 32px;
  height: 32px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.contact-social-row .footer-social:hover {
  background: #ffffff;
  color: var(--primary-blue);
}

/* ── Form sheet ───────────────────────────────────────────── */

.contact-form-panel {
  margin-left: clamp(190px, 17vw, 240px) !important;
  background: color-mix(in srgb, var(--container-bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: clamp(28px, 4vw, 48px) clamp(26px, 4vw, 56px)
    clamp(24px, 3.4vw, 40px) clamp(96px, 10vw, 150px);
  position: relative;
  overflow: hidden;
}

.contact-form-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.contact-form-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: contactOrbFloat 28s ease-in-out infinite;
}

@keyframes contactOrbFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(25px, -25px) scale(1.08);
  }
  50% {
    transform: translate(-15px, 15px) scale(0.95);
  }
  75% {
    transform: translate(15px, 25px) scale(1.03);
  }
}

.contact-form-orb-1 {
  width: 420px;
  height: 420px;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    color-mix(in srgb, var(--primary-blue) 70%, white 30%) 100%
  );
  opacity: 0.08;
  top: -120px;
  right: -120px;
  animation-delay: -5s;
}

.contact-form-orb-2 {
  width: 320px;
  height: 320px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary-blue) 70%, white 30%) 0%,
    var(--primary-blue) 100%
  );
  opacity: 0.07;
  bottom: -80px;
  left: -80px;
  animation-delay: -14s;
}

/* Left-edge glow - bleeds from behind the floating card into the sheet */
.contact-form-orb-3 {
  width: 500px;
  height: 500px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary-blue) 70%, white 30%) 0%,
    var(--primary-blue) 100%
  );
  opacity: 0.09;
  top: 50%;
  left: -280px;
  transform: translateY(-50%);
  animation-delay: -20s;
}

/* Top-left corner glow */
.contact-form-orb-4 {
  width: 500px;
  height: 500px;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    color-mix(in srgb, var(--primary-blue) 70%, white 30%) 100%
  );
  opacity: 0.22;
  top: -160px;
  left: -100px;
  animation-delay: -10s;
}

body.theme-light .contact-form-orb {
  opacity: 0.06;
}

.contact-form-dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--primary-blue) 12%, transparent) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}

body.theme-light .contact-form-dot-grid {
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--primary-blue) 9%, transparent) 1px,
    transparent 1px
  );
}

.contact-form-card {
  width: 100%;
  position: relative;
  z-index: 1;
}

.contact-form-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.6vw, 30px);
}

/* Form panel header: title/subtitle on the left, reply chip + theme toggle
   on the right. */
.contact-form-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 24px;
}

.contact-form-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-form-title {
  font-family: 'Plus Jakarta Sans', var(--font, inherit);
  font-size: 26px;
  font-weight: 800;
  color: var(--heading-color);
  letter-spacing: -0.5px;
  margin: 0 0 6px !important;
}

.contact-form-subtitle {
  font-size: 14px;
  color: var(--muted-text);
  margin: 0;
}

/* Name + email side by side, for a more compact form */
.contact-form-card .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin-bottom: 20px !important;
}

.contact-form-card .form-row-2 .form-group {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .contact-form-card .form-row-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Optional field label suffix */
.form-optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-text);
  margin-left: 4px !important;
}

.contact-char-counter {
  display: block;
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-text);
  margin-top: 4px !important;
}

/* Submit button: base .btn-primary's gradient/frame/shadow/hover stay as-is,
   just a smaller, more rounded pill shape for this page. */
.contact-form-card .form-actions {
  display: flex;
  justify-content: center;
  margin-top: -4px !important;
}

/* Matches the specificity of base_elements.css's own
   `body:not(:has(.admin-container)) .btn-primary` rule (which is higher
   than a plain `.contact-form-card .btn-primary` would be) so this override
   actually wins instead of silently losing to the base declaration. */
body:not(:has(.admin-container)) .contact-form-card .btn-primary,
body:not(:has(.admin-container)) .contact-form-card .button-primary {
  width: auto !important;
  height: 46px !important;
  padding: 0 22px !important;
  font-size: 13px !important;
  border-radius: 999px !important;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1000px) {
  .contact-info-panel {
    position: relative;
    z-index: 3;
    transform: none;
    left: auto;
    top: auto;
    width: auto;
    margin: 0 0 24px !important;
  }

  .contact-form-panel {
    margin-left: 0 !important;
  }
}

@media (max-width: 860px) {
  .contact-page {
    padding: 24px 16px 48px;
  }
}

@media (max-width: 480px) {
  .contact-form-panel,
  .contact-info-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .contact-form-title {
    font-size: 22px;
  }
}

/* Attribution under the contact form ("Powered by [logo] sendform.net") -
   plain, quiet text, not a pill/chip. */
.contact-powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 4px !important;
  font-size: 11.5px;
  color: var(--muted-text);
}
.contact-powered-by a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-text);
  font-weight: 600;
  text-decoration: none;
}
.contact-powered-by a:hover {
  color: var(--text-color);
}
.contact-powered-logo {
  display: block;
  flex-shrink: 0;
  opacity: 0.85;
}
