:root {
  --contact-panel: #10202a;
  --contact-panel-raised: #152b36;
  --contact-panel-field: #112631;
  --contact-panel-line: rgba(209, 236, 238, .14);
  --contact-panel-copy: #edf6f5;
  --contact-panel-muted: #a8c0c3;
  --contact-panel-aqua: #31c8c3;
}

.hero-contact-panel {
  width: min(660px, calc(100vw - 32px));
  max-width: 660px;
  height: min(720px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--contact-panel-line);
  border-radius: 18px;
  background: var(--contact-panel);
  color: var(--contact-panel-copy);
  box-shadow: 0 28px 80px rgba(0, 8, 14, .58);
  font-family: "Plex Arabic", system-ui, sans-serif;
}

.hero-contact-panel::backdrop {
  background: rgba(5, 12, 17, .72);
}

.hero-contact-panel[open] {
  display: flex;
  flex-direction: column;
  animation: contact-panel-enter .3s cubic-bezier(.2, .7, .2, 1) both;
}

.hero-contact-panel.is-closing {
  animation: contact-panel-leave .22s ease both;
}

.contact-panel-header {
  display: flex;
  min-height: 62px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--contact-panel-line);
  background: #0e1d27;
}

.contact-brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
}

.contact-brand-mark img {
  display: block;
  width: 25px;
  height: 25px;
}

.contact-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--contact-panel-line);
  border-radius: 9px;
  background: transparent;
  color: var(--contact-panel-copy);
  font: 300 26px/1 Arial, sans-serif;
  transition: border-color .25s ease, background-color .25s ease;
}

.contact-close:is(:hover, :focus-visible) {
  border-color: rgba(49, 200, 195, .72);
  background: rgba(49, 200, 195, .08);
}

.contact-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  gap: 4px;
  margin: 14px 22px 0;
  padding: 4px;
  border: 1px solid var(--contact-panel-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .025);
}

.contact-view-tabs [role="tab"] {
  min-height: 37px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--contact-panel-muted);
  font: 500 13px/1.2 "Plex Arabic", system-ui, sans-serif;
  transition: color .2s ease, background-color .2s ease;
}

.contact-view-tabs [role="tab"][aria-selected="true"] {
  background: rgba(49, 200, 195, .14);
  color: var(--contact-panel-copy);
}

.contact-panel-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(49, 200, 195, .38) transparent;
}

.contact-panel-body::-webkit-scrollbar { width: 6px; }
.contact-panel-body::-webkit-scrollbar-thumb { background: rgba(49, 200, 195, .34); border-radius: 10px; }

.contact-panel-grid,
.contact-form-column,
.contact-hq-column {
  min-height: 100%;
}

.contact-form-column,
.contact-hq-column {
  box-sizing: border-box;
  padding: 24px 22px 20px;
}

.contact-heading {
  margin: 0 0 20px;
}

.contact-heading h2 {
  margin: 0;
  color: var(--contact-panel-copy);
  font: 600 25px/1.45 "Plex Arabic", system-ui, sans-serif;
}

.contact-supporting-line,
.contact-hq-intro {
  margin: 5px 0 0;
  color: var(--contact-panel-muted);
  font-size: 13px;
  line-height: 1.75;
}

.menassat-contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
}

.contact-service-context,
.contact-phone-field,
.contact-message-field,
.menassat-captcha,
.contact-submit,
.contact-form-status {
  grid-column: 1 / -1;
}

.contact-service-context {
  position: relative;
  display: grid;
  min-height: 72px;
  box-sizing: border-box;
  align-content: center;
  padding: 12px 52px 12px 15px;
  overflow: hidden;
  border: 1px solid rgba(49, 200, 195, .3);
  border-radius: 12px;
  background: rgba(49, 200, 195, .06);
}

.contact-service-context::before {
  position: absolute;
  top: 17px;
  right: 16px;
  width: 19px;
  height: 19px;
  border: 1px solid var(--contact-panel-aqua);
  border-radius: 4px;
  content: "";
  transform: rotate(45deg);
}

.contact-service-context > span {
  margin-bottom: 3px;
  color: var(--contact-panel-aqua);
  font: 600 10px/1.2 Arial, sans-serif;
  letter-spacing: .08em;
}

.contact-service-context strong {
  overflow: hidden;
  color: var(--contact-panel-copy);
  font: 500 14px/1.45 "Plex Arabic", system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-service-context p { display: none; }

.contact-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--contact-panel-copy);
  font: 500 12px/1.3 "Plex Arabic", system-ui, sans-serif;
}

.contact-field > span:first-child {
  color: var(--contact-panel-copy);
}

.contact-field input,
.contact-field textarea,
.contact-phone-control {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--contact-panel-line);
  border-radius: 10px;
  outline: 0;
  background: var(--contact-panel-field);
  color: var(--contact-panel-copy);
  font: 400 14px/1.4 "Plex Arabic", system-ui, sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.contact-field input {
  height: 48px;
  padding: 0 13px;
}

.contact-field textarea {
  display: block;
  min-height: 94px;
  padding: 12px 13px;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder { color: #789196; opacity: 1; }

.contact-field :is(input, textarea):is(:focus, :focus-visible) {
  border-color: rgba(49, 200, 195, .8);
  background: #142e39;
  box-shadow: 0 0 0 3px rgba(49, 200, 195, .11);
}

.contact-phone-control {
  display: flex;
  height: 48px;
  align-items: center;
  direction: ltr;
  overflow: hidden;
}

.contact-phone-control > span {
  flex: 0 0 auto;
  padding: 0 13px;
  border-right: 1px solid var(--contact-panel-line);
  color: var(--contact-panel-muted);
  font: 500 13px/1 Arial, sans-serif;
}

.contact-phone-control input {
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
}

.contact-phone-control:focus-within {
  border-color: rgba(49, 200, 195, .8);
  background: #142e39;
  box-shadow: 0 0 0 3px rgba(49, 200, 195, .11);
}

.menassat-captcha {
  min-height: 42px;
  padding-top: 2px;
}

.contact-submit {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(49, 200, 195, .85);
  border-radius: 11px;
  background: #168f8e;
  color: #f5ffff;
  box-shadow: 0 -10px 18px var(--contact-panel);
  font: 600 14px/1 "Plex Arabic", system-ui, sans-serif;
  transition: background-color .22s ease, transform .22s ease;
}

.contact-submit::after {
  width: 16px;
  height: 1px;
  margin-right: 9px;
  background: currentColor;
  content: "";
  transition: width .22s ease;
}

.contact-submit:is(:hover, :focus-visible) {
  background: #1aa8a4;
  transform: translateY(-1px);
}

.contact-submit:is(:hover, :focus-visible)::after { width: 23px; }
.contact-submit:disabled { cursor: wait; opacity: .7; }
.contact-submit.is-pending span { font-size: 0; }
.contact-submit.is-pending span::after { content: "جارٍ الإرسال…"; font-size: 14px; }

.contact-form-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--contact-panel-line);
  border-radius: 9px;
  color: var(--contact-panel-copy);
  font-size: 12px;
  line-height: 1.7;
}

.contact-form-status[data-state="success"] { border-color: rgba(49, 200, 195, .58); color: #a8f0ec; }
.contact-form-status[data-state="error"] { border-color: rgba(229, 139, 139, .58); color: #ffd0d0; }

.contact-hq-column { padding-top: 24px; }
.contact-hq-heading { margin-bottom: 18px; }

.contact-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.contact-details > div {
  display: grid;
  grid-template-columns: minmax(110px, .55fr) minmax(0, 1.45fr);
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--contact-panel-line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .025);
}

.contact-details dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--contact-panel-muted);
  font-size: 12px;
}

.contact-details dd {
  min-width: 0;
  margin: 0;
  color: var(--contact-panel-copy);
  font-size: 13px;
  line-height: 1.65;
}

.contact-details dd a { color: var(--contact-panel-copy); text-decoration-color: rgba(49, 200, 195, .7); text-underline-offset: 4px; }
.contact-detail-icon { display: grid; width: 17px; height: 17px; flex: 0 0 17px; color: var(--contact-panel-aqua); }
.contact-detail-icon svg { width: 100%; height: 100%; }
.contact-address { display: flex; flex-direction: column; gap: 2px; }
.contact-working-hours dd + dd { grid-column: 2; }

.contact-map-wrap {
  margin-top: 14px;
  border: 1px solid var(--contact-panel-line);
  border-radius: 11px;
  overflow: hidden;
}

.contact-map-heading { padding: 11px 14px; color: var(--contact-panel-muted); font-size: 12px; }
.contact-map { position: relative; height: 145px; }
.contact-map iframe { display: block; width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(.85) brightness(.68); }
.contact-map-link { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: end; padding: 12px; background: linear-gradient(0deg, rgba(8, 20, 27, .84), transparent 62%); color: #fff; text-decoration: none; font-size: 12px; }
.contact-map-link small { margin-top: 3px; color: #c1e9e7; font: 8px Arial, sans-serif; letter-spacing: .08em; }

@keyframes contact-panel-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes contact-panel-leave { to { opacity: 0; transform: translateY(8px) scale(.99); } }

@media (max-width: 760px) {
  .hero-contact-panel {
    width: 100%;
    max-width: none;
    height: min(100dvh, 760px);
    max-height: 100dvh;
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .contact-panel-header { min-height: 58px; padding: 0 18px; }
  .contact-view-tabs { margin: 12px 16px 0; }
  .contact-form-column, .contact-hq-column { padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
  .contact-heading h2 { font-size: 22px; }
  .menassat-contact-form { grid-template-columns: 1fr; gap: 13px; }
  .contact-field { grid-column: 1 / -1; }
  .contact-submit { min-height: 52px; }
  .contact-details > div { grid-template-columns: 1fr; gap: 6px; }
  .contact-working-hours dd + dd { grid-column: auto; }
}

@media (max-height: 600px) and (min-width: 761px) {
  .hero-contact-panel { height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); }
  .contact-panel-header { min-height: 54px; }
  .contact-view-tabs { margin-top: 9px; }
  .contact-form-column, .contact-hq-column { padding-top: 16px; padding-bottom: 14px; }
  .contact-heading { margin-bottom: 13px; }
  .contact-heading h2 { font-size: 22px; }
  .menassat-contact-form { gap: 10px 12px; }
  .contact-field input, .contact-phone-control { height: 44px; }
  .contact-field textarea { min-height: 74px; }
  .menassat-captcha { min-height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-contact-panel[open], .hero-contact-panel.is-closing { animation: none; }
  .contact-close, .contact-view-tabs [role="tab"], .contact-field input, .contact-field textarea, .contact-phone-control, .contact-submit, .contact-submit::after { transition: none; }
}
