/* =========================================================
   CONTACT (İletişim) — gradient side panel + floating-label form
   The card is centered vertically and fits the screen without scrolling
   whenever there's room.
   ========================================================= */

.page-contact {
  display: grid;
  align-items: center;
}

.page-contact .container {
  padding-top: calc(var(--header-h) + 12px);
  padding-bottom: 80px;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  overflow: hidden;
  max-width: 1040px;
  margin: 0 auto;
}

/* Side panel: the blue→violet gradient of the original "about" artwork */
.contact-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(26px, 3.4vw, 40px);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(135deg, #1a4fc4 0%, #5b5fd6 50%, #c46be0 100%);
  overflow: hidden;
  isolation: isolate;
}

.contact-side::after {
  content: "";
  position: absolute;
  right: -30%;
  bottom: -30%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.04), 0 0 0 80px rgba(255, 255, 255, 0.03);
  z-index: -1;
}

.contact-side h1 {
  margin-top: 0;
  font-size: clamp(36px, 4.6vw, 52px);
  font-weight: 400;
}

.contact-side p {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.86);
  max-width: 34ch;
}

.contact-sign {
  font-family: var(--font-script);
  font-size: 46px;
  line-height: 1;
}

/* Paper plane drifting across the panel */
.contact-plane {
  position: absolute;
  top: 46%;
  left: -60px;
  width: 54px;
  height: 54px;
  color: rgba(255, 255, 255, 0.9);
  animation: plane-glide 14s ease-in-out infinite;
  z-index: -1;
}

.contact-plane svg {
  width: 100%;
  height: 100%;
}

@keyframes plane-glide {
  0% { transform: translate(0, 30px) rotate(8deg); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(220px, -30px) rotate(-6deg); }
  90% { opacity: 1; }
  100% { transform: translate(520px, -90px) rotate(-14deg); opacity: 0; }
}

/* Form side */
.contact-main {
  position: relative;
  padding: clamp(24px, 3.2vw, 36px);
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  position: relative;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field textarea {
  width: 100%;
  padding: 22px 16px 8px;
  border-radius: var(--r-s);
  border: 1px solid var(--glass-border);
  background: rgba(10, 14, 50, 0.35);
  color: #fff;
  font-size: 15.5px;
  outline: none;
  transition: border-color var(--t-mid), box-shadow var(--t-mid), background var(--t-mid);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.field label {
  position: absolute;
  left: 17px;
  top: 17px;
  font-size: 15px;
  color: var(--text-3);
  pointer-events: none;
  transform-origin: left top;
  transition: transform var(--t-mid) var(--ease-out), color var(--t-mid);
}

.field label .req {
  color: var(--pink);
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(169, 212, 255, 0.7);
  background: rgba(10, 14, 50, 0.5);
  box-shadow: 0 0 0 4px rgba(106, 168, 255, 0.16);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(0.78);
  color: var(--sky);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: rgba(255, 130, 160, 0.8);
}

.field-error {
  display: block;
  min-height: 0;
  margin-top: 6px;
  font-size: 13px;
  color: #ffadc3;
}

.field-error:empty {
  display: none;
}

.field-count {
  position: absolute;
  right: 14px;
  top: 8px;
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.form-note {
  font-size: 13px;
  color: var(--text-3);
}

.btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .spinner {
  display: block;
}

.btn.is-loading .send-icon {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Cloudflare's robot check: usually invisible, a small box only when needed */
.turnstile-box:not(:empty) {
  grid-column: 1 / -1;
  min-height: 0;
}

.form-alert {
  grid-column: 1 / -1;
  display: none;
  padding: 12px 16px;
  border-radius: var(--r-s);
  background: rgba(255, 120, 150, 0.14);
  border: 1px solid rgba(255, 130, 160, 0.4);
  font-size: 14px;
  color: #ffd2dd;
}

.form-alert.is-visible {
  display: block;
}

/* "Coming soon" state until the admin panel is live */
.form-soon {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: var(--r-m);
  background: linear-gradient(120deg, rgba(106, 168, 255, 0.18), rgba(200, 115, 222, 0.18));
  border: 1px solid var(--glass-border-strong);
  font-weight: 600;
  font-size: 14.5px;
}

.form-soon svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--sky);
}

.contact-main.is-closed .form-soon {
  display: flex;
}

.contact-main.is-closed .contact-form {
  opacity: 0.55;
  filter: saturate(0.7);
  pointer-events: none;
}

/* Success state */
.contact-success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms var(--ease-out);
}

.contact-main.is-sent .contact-form {
  opacity: 0;
  visibility: hidden;
}

.contact-main.is-sent .contact-success {
  opacity: 1;
  visibility: visible;
}

.success-mark {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 18px 40px -12px rgba(120, 100, 240, 0.85);
  transform: scale(0.6);
  transition: transform 700ms var(--ease-spring);
}

.contact-main.is-sent .success-mark {
  transform: scale(1);
}

.success-mark svg {
  width: 40px;
  height: 40px;
}

.success-mark path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  transition: stroke-dashoffset 700ms var(--ease-out) 300ms;
}

.contact-main.is-sent .success-mark path {
  stroke-dashoffset: 0;
}

.contact-success h2 {
  margin-top: 10px;
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
}

.contact-success p {
  color: var(--text-2);
  max-width: 36ch;
}

.contact-success .btn {
  margin-top: 12px;
}

@media (max-width: 820px) {
  .contact-card {
    grid-template-columns: 1fr;
  }

  .contact-side {
    text-align: center;
    align-items: center;
  }

  .contact-side p {
    margin-inline: auto;
  }

}

@media (max-width: 520px) {
  .contact-form {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    width: 100%;
  }
}
