:root {
  --navy: #004976;
  --blue: #004c97;
  --teal: #00a499;
  --teal-dark: #008f85;
  --light: #f3f3f3;
  --ink: #000001;
  --white: #ffffff;
  --muted: rgba(0, 73, 118, 0.7);
  --border: rgba(0, 73, 118, 0.22);
  --focus: rgba(0, 164, 153, 0.25);
  --danger: #c62828;
  --danger-bg: #fdecec;

  --radius: 10px;
  --font: "SST Arabic", "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--light);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Header */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  padding-inline-start: 14px;
  border-inline-start: 6px solid var(--teal);
  line-height: 1.3;
}

.brand img {
  width: 132px;
  height: auto;
}

/* Main */

.main {
  flex: 1;
  padding-block: 36px 48px;
}

.intro {
  margin-bottom: 24px;
}

.intro__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
}

.intro__text {
  margin: 0;
  font-weight: 300;
  color: var(--muted);
  max-width: 640px;
}

/* Card */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 73, 118, 0.06);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}

.card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--white);
  background: linear-gradient(160deg, var(--teal), var(--navy));
}

.card__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--teal);
}

/* Form */

.form {
  padding: 28px;
}

.field {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px 24px;
  align-items: start;
  margin-bottom: 18px;
}

.field__label {
  padding-top: 10px;
  font-weight: 500;
  color: var(--navy);
}

.req {
  color: var(--danger);
  font-size: 13px;
  margin-inline-start: 2px;
}

.field__control {
  min-width: 0;
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: rgba(0, 73, 118, 0.35);
}

.input:hover {
  border-color: rgba(0, 73, 118, 0.4);
}

.input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--focus);
}

.input--ltr {
  direction: ltr;
  text-align: right;
}

.input--ltr::placeholder {
  text-align: right;
}

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

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.15);
}

.field__error {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.field__error:empty {
  display: none;
}

.link-button {
  padding: 0;
  font: inherit;
  color: var(--teal);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.field__hint {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
}

.field__meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.counter {
  margin-top: 6px;
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--muted);
  direction: ltr;
}

/* Select */

.select {
  position: relative;
}

.select__input {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-start: 56px;
  cursor: pointer;
}

.select__input:disabled {
  cursor: progress;
  color: var(--muted);
}

.select__arrow {
  position: absolute;
  inset-inline-start: 6px;
  top: 6px;
  bottom: 6px;
  width: 38px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--teal);
  border-radius: 7px;
  pointer-events: none;
}

/* File */

.file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 6px 6px 6px 14px;
  padding-inline-start: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.file__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file__input:focus-visible ~ .file__button {
  box-shadow: 0 0 0 4px var(--focus);
}

.file__name {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file__button {
  flex: none;
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.file__button:hover {
  background: #e8eef2;
}

.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.file-list:empty {
  display: none;
}

.file-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--light);
  border-radius: 8px;
}

.file-list__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}

.file-list__meta {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-list__size {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  direction: ltr;
}

.file-list__remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.file-list__remove:hover {
  background: var(--danger-bg);
}

/* Alert */

.form-alert {
  margin-bottom: 20px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(198, 40, 40, 0.25);
  border-radius: var(--radius);
}

/* Buttons */

.form__actions {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  margin-top: 26px;
}

.form__actions .btn {
  grid-column: 2;
  justify-self: start;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 180px;
  min-height: 48px;
  padding: 10px 28px;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  color: var(--white);
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--teal-dark);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.8;
}

.btn--outline {
  color: var(--teal);
  background: var(--white);
}

.btn--outline:hover {
  color: var(--white);
  background: var(--teal);
}

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

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

/* Success */

.success {
  padding: 48px 28px 44px;
  text-align: center;
}

.success:focus {
  outline: none;
}

.success__icon {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  color: var(--white);
  background: var(--teal);
  border-radius: 50%;
}

.success__title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.success__text {
  margin: 0 auto 28px;
  max-width: 420px;
  padding: 18px 20px;
  line-height: 2;
  color: var(--navy);
  background: var(--light);
  border-radius: var(--radius);
}

.success__text strong {
  color: var(--teal);
  font-size: 18px;
}

/* Decorative line + footer */

.palm-line {
  position: relative;
  height: 110px;
  margin-top: -40px;
  background: url("../img/palm-line.png") no-repeat right bottom / auto 110px;
  pointer-events: none;
}

.palm-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 180px;
  bottom: 0.5px;
  height: 2px;
  background: var(--teal);
}

.site-footer {
  color: var(--white);
  background: var(--navy);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-block: 16px;
  font-size: 14px;
}

.site-footer__item {
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

.site-footer__label {
  font-weight: 300;
  opacity: 0.85;
}

.site-footer__value {
  text-decoration: none;
  font-weight: 500;
}

.site-footer__value:hover {
  text-decoration: underline;
}

.site-footer__sep {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.4);
}

.site-footer__social {
  font-weight: 300;
}

/* Embedded mode (inside an iframe on the main website) */

.is-embedded body {
  min-height: 0;
  background: transparent;
}

.is-embedded .site-header,
.is-embedded .intro,
.is-embedded .palm-line,
.is-embedded .site-footer {
  display: none;
}

.is-embedded .container {
  max-width: none;
  padding-inline: 0;
}

.is-embedded .main {
  padding-block: 2px;
}

.is-embedded .card {
  box-shadow: none;
}

/* Responsive */

@media (max-width: 720px) {
  .page-title {
    font-size: 22px;
  }

  .brand img {
    width: 104px;
  }

  .main {
    padding-block: 24px 32px;
  }

  .card__head,
  .form {
    padding-inline: 18px;
  }

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

  .field__label {
    padding-top: 0;
  }

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

  .form__actions .btn {
    grid-column: 1;
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}
