/* ═══════════════════════════════════════════════════════════
   WCIP Frontend — İletişim Sayfası Stilleri
   WoodMart tema izolasyonlu, Soft UI
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Reset — WoodMart override koruması ────────────────── */
div.wcip-wrap,
div.wcip-wrap *,
div.wcip-wrap *::before,
div.wcip-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

div.wcip-wrap {
  all: unset;
  display: block;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #311f1e;
  -webkit-text-size-adjust: 100%;
}

/* ── CSS Custom Properties ─────────────────────────────────── */
div.wcip-wrap {
  --wcip-white: #ffffff;
  --wcip-bg: #f6f6f6;
  --wcip-card: #ffffff;
  --wcip-border: #eeebe9;
  --wcip-border-light: #f2efed;
  --wcip-inset-bg: #f9f7f6;
  --wcip-text-900: #311f1e;
  --wcip-text-700: #5a3f3d;
  --wcip-text-500: #8c7170;
  --wcip-text-400: #a8908e;
  --wcip-text-300: #c4b3b1;
  --wcip-accent-600: #6b4240;
  --wcip-accent-700: #5a3533;
  --wcip-accent-50: #faf5f5;
  --wcip-success: #3d8b6e;
  --wcip-success-bg: #eef7f3;
  --wcip-error: #b44a4a;
  --wcip-error-bg: #fdf0f0;
  --wcip-warning: #b8863b;
  --wcip-warning-bg: #fef4e6;
  --wcip-radius-card: 16px;
  --wcip-radius-input: 12px;
  --wcip-radius-btn: 12px;
  --wcip-shadow-card: 0 1px 3px rgba(49,31,30,0.04), 0 4px 12px rgba(49,31,30,0.03);
}

/* ── Page layout ───────────────────────────────────────────── */
div.wcip-wrap.wcip-page {
  max-width: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  float: none;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--wcip-white);
}

div.wcip-wrap .wcip-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Card ──────────────────────────────────────────────────── */
div.wcip-wrap .wcip-card {
  background: var(--wcip-card);
  border: 1px solid var(--wcip-border);
  border-radius: var(--wcip-radius-card);
  box-shadow: var(--wcip-shadow-card);
}

div.wcip-wrap .wcip-form-card {
  padding: 44px 36px 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: wcip-card-entrance 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

/* ── Header ────────────────────────────────────────────────── */
div.wcip-wrap .wcip-form-header {
  margin-bottom: 32px;
  text-align: left;
}

div.wcip-wrap .wcip-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--wcip-text-900);
  line-height: 1.2;
  margin: 0;
  padding: 0;
  letter-spacing: -0.02em;
}

div.wcip-wrap .wcip-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--wcip-text-400);
  line-height: 1.5;
  margin-top: 6px;
}

/* ── Form ──────────────────────────────────────────────────── */
div.wcip-wrap .wcip-form {
  display: block;
}

/* ── Field ─────────────────────────────────────────────────── */
div.wcip-wrap .wcip-field {
  position: relative;
  margin-bottom: 22px;
}

/* ── Input / Textarea base ─────────────────────────────────── */
div.wcip-wrap .wcip-form .wcip-field .wcip-input,
body div.wcip-wrap input[type="text"],
body div.wcip-wrap input[type="email"],
body div.wcip-wrap textarea {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 16px 8px;
  font-size: 16px;  /* FX-017: iOS auto-zoom için min 16px */
  font-family: inherit;
  color: var(--wcip-text-900);
  background-color: var(--wcip-inset-bg);
  border: 1px solid var(--wcip-border-light);
  border-radius: var(--wcip-radius-input);
  outline: none;
  min-height: 52px;
  height: auto;
  line-height: 1.4;
  box-shadow: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

/* Textarea overrides */
div.wcip-wrap .wcip-form .wcip-field .wcip-textarea {
  padding: 28px 16px 12px;
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

/* Focus */
div.wcip-wrap .wcip-field .wcip-input:focus {
  border: 1.5px solid var(--wcip-accent-600);
  box-shadow: 0 0 0 3px var(--wcip-accent-50);
}

/* Error state */
div.wcip-wrap .wcip-field.wcip-has-error .wcip-input {
  border: 1.5px solid var(--wcip-error);
}

/* Error message */
div.wcip-wrap .wcip-field .wcip-error-msg {
  display: block;         /* FX-017: pre-reserve space, layout shift önle */
  visibility: hidden;     /* görünmez ama yer tutar */
  min-height: 1.6em;      /* hata mesajı slot rezerve */
  margin-top: 5px;
  font-size: 12px;
  color: var(--wcip-error);
  font-weight: 500;
  line-height: 1.4;
}

div.wcip-wrap .wcip-field.wcip-has-error .wcip-error-msg {
  visibility: visible;    /* FX-017: display değil visibility toggle */
  animation: wcip-fade-in 0.2s ease;
}

/* ── Floating Label ────────────────────────────────────────── */
div.wcip-wrap .wcip-field .wcip-label {
  position: absolute;
  left: 17px;
  top: 16px;
  font-size: 15px;
  font-weight: 400;
  color: var(--wcip-text-400);
  text-transform: none;
  letter-spacing: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  line-height: 1;
  background: transparent;
  padding: 0;
  border-radius: 4px;
}

/* Active: focus or has value */
div.wcip-wrap .wcip-field .wcip-input:focus ~ .wcip-label,
div.wcip-wrap .wcip-field .wcip-input:not(:placeholder-shown) ~ .wcip-label {
  top: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--wcip-accent-600);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--wcip-inset-bg);
  padding: 2px 5px;
}

/* Textarea label adjustment */
div.wcip-wrap .wcip-field .wcip-textarea:focus ~ .wcip-label,
div.wcip-wrap .wcip-field .wcip-textarea:not(:placeholder-shown) ~ .wcip-label {
  top: 9px;
}

/* Error label color */
div.wcip-wrap .wcip-field.wcip-has-error .wcip-input:focus ~ .wcip-label,
div.wcip-wrap .wcip-field.wcip-has-error .wcip-input:not(:placeholder-shown) ~ .wcip-label {
  color: var(--wcip-error);
}

/* ── Submit button ─────────────────────────────────────────── */
div.wcip-wrap .wcip-submit-btn,
body div.wcip-wrap button[type="submit"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--wcip-radius-btn);
  border: none;
  background-color: var(--wcip-text-900);
  color: var(--wcip-white);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(49,31,30,0.1);
  transition: all 0.2s ease;
  margin-top: 6px;
}

div.wcip-wrap .wcip-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49,31,30,0.15);
}

div.wcip-wrap .wcip-submit-btn.wcip-loading {
  background: var(--wcip-text-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* SVG icon in button */
div.wcip-wrap .wcip-submit-btn .wcip-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Spinner */
div.wcip-wrap .wcip-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wcip-spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Success state ─────────────────────────────────────────── */
div.wcip-wrap .wcip-success-state {
  text-align: center;
  padding: 20px 0;
}

div.wcip-wrap .wcip-success-check {
  display: inline-block;
}

div.wcip-wrap .wcip-check-path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  transition: stroke-dashoffset 0.7s ease 0.4s;
}

div.wcip-wrap .wcip-success-state.wcip-visible .wcip-check-path {
  stroke-dashoffset: 0;
}

div.wcip-wrap .wcip-success-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--wcip-text-900);
  margin-top: 22px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s ease 0.9s;
  line-height: 1.3;
}

div.wcip-wrap .wcip-success-state.wcip-visible .wcip-success-title {
  opacity: 1;
  transform: translateY(0);
}

div.wcip-wrap .wcip-success-subtitle {
  font-size: 13px;
  color: var(--wcip-text-400);
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.4s ease 1.2s;
  line-height: 1.5;
}

div.wcip-wrap .wcip-success-state.wcip-visible .wcip-success-subtitle {
  opacity: 1;
}

div.wcip-wrap .wcip-new-message-link {
  display: inline-block;
  margin-top: 20px;
  padding: 9px 22px;
  border-radius: 10px;
  border: 1px solid var(--wcip-border);
  background: var(--wcip-white);
  color: var(--wcip-text-700);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.4s ease 1.4s, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  line-height: 1;
}

div.wcip-wrap .wcip-success-state.wcip-visible .wcip-new-message-link {
  opacity: 1;
}

div.wcip-wrap .wcip-new-message-link:hover {
  background: var(--wcip-bg);
  border-color: var(--wcip-border);
}

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes wcip-card-entrance {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes wcip-spin {
  to { transform: rotate(360deg); }
}

@keyframes wcip-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  div.wcip-wrap.wcip-page {
    padding: 24px 12px;
    min-height: auto;
  }
  div.wcip-wrap .wcip-form-card {
    padding: 28px 20px;
  }
  div.wcip-wrap .wcip-title {
    font-size: 21px;
  }
  div.wcip-wrap .wcip-submit-btn {
    min-height: 44px;
  }
}
