:root {
  --paper: #F5F6F2;
  --ink: #00273a;
  --ink-soft: #5B645F;
  --indigo: #00689b;
  --course-button: #00689b;
  --line: #DCDFD6;
  --card: #FFFFFF;
  --danger: #C94C4C;
  --success: #15803d;
  --shadow: 0 12px 32px rgba(0, 39, 58, .06);
}

body.dark {
  --paper: #15181C;
  --ink: #E8EAE4;
  --ink-soft: #9AA39B;
  --card: #1E2227;
  --line: #33383B;
  --indigo: #0088C7;
  --course-button: #0088C7;
  --danger: #E2897A;
  --success: #4ade80;
  --shadow: 0 12px 32px rgba(0, 0, 0, .16);
}

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

html {
  max-width: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  font-family: "Tajawal", sans-serif;
  background: var(--paper);
  color: var(--ink);
  transition: background .25s ease, color .25s ease;
}

body,
button,
input,
textarea {
  font-family: "Tajawal", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-size: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 104, 155, .25);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Header */

.top-header {
  min-height: 77px;
  display: flex;
  flex-direction: row;
  direction: ltr;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 35px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.header-side {
  display: flex;
  flex-direction: row;
  direction: ltr;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  flex-direction: row-reverse;
  direction: ltr;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 900;
}

.brand-text span {
  color: var(--ink-soft);
  font-size: 11px;
}

.theme-btn,
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: .2s;
}

.theme-btn:hover,
.icon-btn:hover,
.logout-button:hover {
  border-color: var(--indigo);
  transform: translateY(-2px);
}

.theme-icon {
  width: 19px;
  height: 19px;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition: .2s;
}

/* Page and form */

.register-main {
  width: 100%;
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
  padding: 40px 24px 55px;
}

.register-card {
  min-width: 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  color: var(--indigo);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.form-heading h2 {
  margin: 7px 0 5px;
  font-size: 25px;
  font-weight: 900;
}

.form-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.required-note {
  flex-shrink: 0;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}

.required-note span,
.field label > span:not(.optional-label) {
  color: var(--danger);
}

.form-section,
.field {
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.section-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--indigo);
  font-size: 12px;
  font-weight: 900;
}

.section-title h3 {
  margin: 1px 0 4px;
  font-size: 18px;
  font-weight: 900;
}

.section-title p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

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

.field {
  display: grid;
  align-content: start;
  gap: 8px;
}

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

.field label {
  font-size: 14px;
  font-weight: 800;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.field textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.9;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-soft);
  opacity: .75;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--indigo);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 104, 155, .08);
}

.field-hint {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.optional-label {
  margin-right: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.form-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

/* Choice cards */

.choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.platform-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.method-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.choice-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-content,
.method-content {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60px;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color .2s, background .2s, transform .2s;
}

.platform-card:hover .choice-content,
.method-card:hover .method-content {
  border-color: var(--indigo);
}

.platform-card:hover .choice-content {
  transform: translateY(-1px);
}

.choice-card > input:checked + .choice-content,
.choice-card > input:checked + .method-content {
  border-color: var(--indigo);
  background: rgba(0, 104, 155, .07);
}

.choice-card > input:focus-visible + .choice-content,
.choice-card > input:focus-visible + .method-content {
  outline: 3px solid rgba(0, 104, 155, .25);
  outline-offset: 3px;
}

/* Social platforms: hide symbols */

.platform-symbol {
  display: none !important;
}

.platform-card .choice-content {
  justify-content: center;
  min-height: 48px;
  padding: 11px 10px;
}

.choice-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.choice-check {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.choice-card > input:checked + .choice-content .choice-check,
.choice-card > input:checked + .method-content .choice-check {
  border-color: var(--indigo);
  background: var(--indigo);
}

.choice-card > input:checked + .choice-content .choice-check::after,
.choice-card > input:checked + .method-content .choice-check::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Marketing methods */

.method-content {
  min-height: 0;
  gap: 10px;
  padding: 13px 14px;
}

.method-icon {
  display: none !important;
}

.method-content > span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.method-content strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.method-content small {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

/* Social profile fields */

.profile-fields {
  margin-top: 18px;
}

.profile-field {
  animation: reveal .2s ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.validation-hint {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

/* Policy agreement */

.policy-agreement {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}

.agreement-label > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.agreement-box {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}

.agreement-label > input:checked + .agreement-box {
  border-color: var(--indigo);
  background: var(--indigo);
}

.agreement-label > input:checked + .agreement-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agreement-label > input:focus-visible + .agreement-box {
  outline: 3px solid rgba(0, 104, 155, .25);
  outline-offset: 3px;
}

.agreement-text {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 2;
}

.agreement-text a {
  color: var(--indigo);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Submit button and messages */

.primary-btn {
  min-height: 49px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: 11px;
  background: var(--course-button);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s, opacity .2s;
}

.primary-btn:hover {
  transform: translateY(-1px);
  opacity: .94;
}

.primary-btn:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.login-submit {
  width: 100%;
  margin-top: 20px;
}

.form-message {
  display: none;
  margin-top: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.9;
}

.form-message.error {
  display: block;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.form-message.success {
  display: block;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}

.form-disclaimer {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.9;
  text-align: center;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer */

.site-footer {
  padding: 0 20px 25px;
  text-align: center;
}

.footer-line {
  width: 100%;
  max-width: 1110px;
  height: 1px;
  margin: 0 auto 18px;
  background: var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px 22px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--ink-soft);
  font-size: 13px;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--indigo);
}

.site-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

/* Responsive layout */

@media (max-width: 700px) {
  .top-header {
    padding: 14px 18px;
  }

  .register-main {
    padding: 30px 16px 42px;
  }

  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .register-card {
    border-radius: 18px;
  }
}

@media (max-width: 520px) {
  .top-header {
    gap: 8px;
    padding: 12px;
  }

  .header-side {
    gap: 6px;
  }

  .theme-btn {
    width: 36px;
    height: 36px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 35px;
    height: 35px;
  }

  .brand-text strong {
    font-size: 12px;
  }

  .brand-text span {
    font-size: 10px;
  }

  .logout-button {
    padding: 8px 9px;
    font-size: 11px;
  }

  .register-main {
    padding: 24px 12px 34px;
  }

  .register-card {
    padding: 21px 15px;
  }

  .form-heading {
    flex-direction: column;
    gap: 5px;
    margin-bottom: 24px;
  }

  .form-heading h2 {
    font-size: 22px;
  }

  .required-note {
    margin-top: 0;
  }

  .form-grid,
  .profile-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-full {
    grid-column: auto;
  }

  .section-title {
    gap: 9px;
  }

  .section-title h3 {
    font-size: 16px;
  }

  .section-title p {
    font-size: 12px;
  }

  .section-number {
    width: 32px;
    height: 32px;
  }

  .platform-card .choice-content {
    min-height: 46px;
    padding: 10px 8px;
  }

  .choice-label {
    font-size: 12px;
  }

  .method-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .method-content {
    padding: 12px;
  }

  .form-divider {
    margin: 22px 0;
  }

  .footer-links {
    gap: 10px 16px;
  }
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}