:root {
  --bg: #813758;
  --bg-deep: #5f1f3e;
  --surface: rgba(255, 248, 241, 0.42);
  --surface-strong: rgba(255, 250, 246, 0.62);
  --border: rgba(210, 166, 108, 0.3);
  --text: #fff8f3;
  --muted: #f8e7d8;
  --heading: #fff8f3;
  --accent: #d1a66d;
  --accent-deep: #bc8b53;
  --accent-soft: #ecd2b1;
  --input-bg: rgba(96, 31, 62, 0.48);
  --input-bg-strong: rgba(111, 38, 71, 0.72);
  --menu-bg: #f7eee6;
  --menu-text: #53253b;
  --success: #e9ffe2;
  --success-bg: rgba(71, 155, 88, 0.18);
  --error: #ffe3e3;
  --error-bg: rgba(181, 63, 63, 0.18);
  --shadow: 0 24px 70px rgba(55, 17, 35, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(236, 210, 177, 0.28), transparent 22%),
    radial-gradient(circle at left center, rgba(255, 255, 255, 0.12), transparent 18%),
    linear-gradient(145deg, #a14e74 0%, var(--bg) 52%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.35;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero-panel,
.form-panel {
  border: 1px solid var(--border);
  border-radius: 32px;
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 38px 34px;
  margin-bottom: 24px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 340px;
  gap: 12px;
}

.brand-side,
.copy-side {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-side {
  align-items: center;
  text-align: center;
  padding-inline: 18px;
  width: 100%;
  max-width: 520px;
  justify-self: end;
}

.logo-stage {
  width: min(100%, 430px);
  padding: 18px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255, 247, 240, 0.9), rgba(248, 235, 222, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 22px 40px rgba(122, 50, 80, 0.18);
  margin-inline: auto;
}

.brand-logo {
  width: 100%;
  display: block;
  animation: logoFloat 8.6s ease-in-out infinite;
  transform-origin: center;
  filter: drop-shadow(0 18px 28px rgba(97, 31, 62, 0.16));
}

.brand-tagline {
  margin: 14px 0 0;
  font-family: "Noto Naskh Arabic", serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  color: #fff4ea;
  letter-spacing: 0.01em;
  width: 100%;
  text-align: center;
}

.copy-side {
  align-items: flex-start;
  text-align: right;
  padding-inline: 22px;
  width: 100%;
  justify-self: start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-soft);
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.1;
  color: var(--heading);
}

.form-panel {
  padding: 32px;
}

.section-copy {
  margin-bottom: 22px;
}

.section-copy p {
  margin-bottom: 0;
  color: #fff5ec;
  line-height: 1.8;
}

.alert {
  padding: 14px 18px;
  border-radius: 18px;
  margin-bottom: 18px;
  font-weight: 700;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.alert.success {
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid rgba(121, 214, 136, 0.28);
}

.alert.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.alert.auto-dismiss {
  animation: fadeAlertOut 0.45s ease 10s forwards;
}

.alert.error {
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid rgba(255, 155, 155, 0.22);
}

.application-form {
  display: grid;
  gap: 22px;
}

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

label {
  display: grid;
  gap: 10px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(241, 215, 185, 0.24);
  border-radius: 18px;
  padding: 15px 16px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 248, 243, 0.58);
}

input::file-selector-button {
  border: 0;
  border-radius: 12px;
  margin-left: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f2d3a8, var(--accent));
  color: #4a2414;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

input:focus,
textarea:focus,
.select-trigger:focus-visible {
  border-color: rgba(241, 201, 143, 0.95);
  box-shadow: 0 0 0 4px rgba(241, 201, 143, 0.12);
  background: var(--input-bg-strong);
}

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

.custom-select {
  position: relative;
}

.select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(241, 215, 185, 0.3);
  border-radius: 18px;
  padding: 15px 16px;
  background: linear-gradient(180deg, rgba(110, 40, 68, 0.82), rgba(92, 28, 56, 0.94));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.select-trigger.is-open {
  border-color: rgba(241, 201, 143, 0.95);
  box-shadow: 0 0 0 4px rgba(241, 201, 143, 0.12);
  background: linear-gradient(180deg, rgba(121, 47, 76, 0.95), rgba(96, 31, 62, 1));
}

.select-arrow {
  width: 11px;
  height: 11px;
  border-left: 2px solid var(--accent-soft);
  border-bottom: 2px solid var(--accent-soft);
  transform: rotate(-45deg);
  transition: transform 180ms ease;
  flex-shrink: 0;
}

.select-trigger.is-open .select-arrow {
  transform: rotate(135deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(188, 139, 83, 0.34);
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.98), rgba(248, 238, 230, 0.96));
  box-shadow: 0 24px 42px rgba(68, 22, 42, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  z-index: 10;
}

.custom-select.is-open .select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-option {
  border: 0;
  border-radius: 14px;
  padding: 13px 14px;
  background: transparent;
  color: var(--menu-text);
  text-align: right;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.select-option:hover,
.select-option:focus-visible,
.select-option.is-selected {
  background: linear-gradient(135deg, #e8c89f, #d4a56b);
  color: #4b2330;
  transform: translateY(-1px);
  outline: none;
}

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

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.submit-button {
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  background: linear-gradient(135deg, #f4d4a7, var(--accent-deep));
  color: #4a2414;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(175, 122, 67, 0.24);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(175, 122, 67, 0.3);
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes fadeAlertOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 20px;
  }

  .brand-side,
  .copy-side {
    align-items: center;
    text-align: center;
    padding-inline: 0;
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding: 14px 0 28px;
  }

  .hero-panel,
  .form-panel {
    border-radius: 24px;
    padding: 22px 18px;
  }

  .hero-grid {
    min-height: auto;
  }

  .logo-stage {
    width: min(100%, 290px);
    padding: 12px;
    border-radius: 24px;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .form-footer {
    align-items: stretch;
  }

  .submit-button {
    width: 100%;
  }
}
