:root {
  --primary: #1f8a4c;
  --primary-dark: #14643a;
  --primary-soft: #e6f5ec;
  --background: #f4faf6;
  --card: #ffffff;
  --text: #153323;
  --muted: #607568;
  --border: #d6e8dc;
  --danger: #b42318;
  --success: #177245;
  --shadow: 0 22px 55px rgba(21, 80, 46, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(31, 138, 76, 0.1), rgba(255, 255, 255, 0) 42%),
    var(--background);
}

button,
input,
textarea,
select {
  font: inherit;
}

.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 16px;
}

.form-card {
  width: min(100%, 860px);
  position: relative;
  background: var(--card);
  border: 1px solid rgba(214, 232, 220, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(58px, 7vw, 68px) clamp(20px, 4vw, 36px) clamp(20px, 4vw, 36px);
}

.language-corner {
  position: absolute;
  inset-block-start: 14px;
  left: 14px;
  min-width: 92px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.language-toggle {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  padding: 0;
}

.language-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.active-language {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.language-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.language-corner:focus-within .language-toggle,
.language-corner:hover .language-toggle {
  color: var(--primary);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-inline-end: 54px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 23px;
  font-weight: 700;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.25;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.arabic-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.95);
  color: #1d4ed8;
  font-size: 14px;
  line-height: 1.7;
}

.arabic-note span:first-child {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 700;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 15px;
  font-weight: 700;
}

input,
textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfb;
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 128px;
}

#summary {
  resize: none;
}

.summary-counter {
  align-self: flex-end;
  color: #607568;
  font-size: 12px;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.summary-counter.is-limit {
  color: #b26a2f;
}

input:focus,
textarea:focus,
.field select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 138, 76, 0.16);
}

.upload-box {
  position: relative;
  min-height: 92px;
  border: 2px dashed #9bcfaf;
  border-radius: 8px;
  background: var(--primary-soft);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-box:hover,
.upload-box:focus-within {
  border-color: var(--primary);
  background: #edf8f1;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  text-align: center;
  color: var(--primary-dark);
}

.upload-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.upload-content strong {
  font-size: 15px;
}

.upload-content small {
  color: var(--muted);
  font-size: 12px;
}

.image-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfb;
}

.image-preview img {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
  border-radius: 8px;
  background: #edf6f0;
}

.submit-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.submit-button {
  width: 100%;
  margin-top: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
}

.secondary-button {
  background: #f8e8e6;
  color: var(--danger);
  white-space: nowrap;
  min-height: 42px;
  padding: 10px 16px;
}

.submit-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.submit-button:hover {
  background: var(--primary-dark);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.message {
  min-height: 24px;
  margin: 16px 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.6;
}

.message.success {
  padding: 12px 14px;
  border-color: rgba(23, 114, 69, 0.22);
  background: rgba(232, 247, 239, 0.92);
  color: var(--success);
}

.message.error {
  padding: 12px 14px;
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(248, 232, 230, 0.82);
  color: var(--danger);
}

.message.sending {
  position: relative;
  padding: 12px 14px;
  border-color: rgba(31, 138, 76, 0.24);
  background: rgba(230, 245, 236, 0.9);
  color: var(--primary-dark);
  overflow: hidden;
}

.message.sending::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--primary);
  animation: sendingPulse 1.15s ease-in-out infinite;
}

@keyframes sendingPulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

.footer-bar {
  width: min(100%, 860px);
  position: relative;
  padding: 22px 18px 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0;
  background: linear-gradient(180deg, rgba(106, 184, 132, 0.9), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-bar::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: min(160px, 42%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(31, 138, 76, 0), rgba(31, 138, 76, 0.34), rgba(31, 138, 76, 0));
}

@media (max-width: 700px) {
  .page {
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
  }

  .form-card {
    padding: 58px 20px 20px;
  }

  .card-header {
    align-items: flex-start;
    margin-bottom: 22px;
    padding-inline-end: 48px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .image-preview {
    grid-template-columns: 1fr;
  }

  .upload-box,
  .upload-content {
    min-height: 88px;
  }

  .secondary-button {
    width: 100%;
  }

  .footer-bar {
    width: 100%;
    padding: 12px 14px;
  }
}
