:root {
  --brand-red: #a50000;
  --sheet: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #d7d7d7;
  --disabled: #d9d9d9;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.lp-page,
body.ty-page {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  background: var(--brand-red);
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* —— Header —— */
.topbar {
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--brand-red);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  height: 34px;
  width: auto;
  display: block;
  mix-blend-mode: screen;
}

.lang-pill {
  appearance: none;
  border: 0;
  background: #fff;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

/* —— Hero —— */
.hero {
  width: 100%;
  background: #2a0000;
}

.hero .carousel,
.hero .carousel-inner,
.hero .carousel-item {
  height: 42vw;
  max-height: 280px;
  min-height: 180px;
}

.hero .carousel-item {
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* —— White sheet —— */
.sheet {
  position: relative;
  z-index: 5;
  margin-top: -28px;
  background: var(--sheet);
  color: var(--ink);
  border-radius: 40px;
  padding: 28px 20px 24px;
  text-align: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}

.sheet-title {
  margin: 0 0 12px;
  font-size: clamp(20px, 5.4vw, 28px);
  font-weight: 800;
  line-height: 1.35;
  color: #111;
}

.sheet-sub {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

/* —— Phone field —— */
.phone-field {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.phone-icon {
  display: inline-flex;
  color: #111;
  flex-shrink: 0;
}

.phone-prefix {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
}

.phone-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.04em;
}

.pin-field {
  justify-content: center;
}

.pin-field input {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 24px;
}

/* —— CTA —— */
.cta-btn {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.cta-btn.disabled_btn,
.cta-btn:disabled {
  background: var(--disabled);
  color: #222;
  cursor: not-allowed;
}

.cta-btn:not(.disabled_btn):not(:disabled),
.cta-btn.cta-btn--active {
  background: var(--brand-red);
  color: #fff;
}

.cta-btn:not(.disabled_btn):not(:disabled):active {
  transform: scale(0.985);
}

.rate-line {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.55;
}

.pin-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pin-hint a {
  color: var(--brand-red);
  font-weight: 700;
  margin-inline-start: 6px;
}

.error-msg {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f1;
  color: #b00000;
  font-size: 13px;
  font-weight: 600;
}

.error-msg[hidden] {
  display: none !important;
}

/* —— Operators —— */
.operator-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}

.op-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
  padding: 12px;
}

.op-btn[data-operator="ooredoo"] {
  background: #ed1c24;
}

.op-btn[data-operator="zain"] {
  background: #6ebe4a;
}

.op-btn small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}

.op-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* —— Footer T&C on red —— */
.tnc-footer {
  background: var(--brand-red);
  padding: 18px 16px 28px;
}

.tnc-footer .disclaimer {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  line-height: 1.7;
  font-weight: 500;
  text-align: start;
}

.tnc-footer .disclaimer a {
  color: #fff;
  text-decoration: underline;
}

/* —— Loading ring —— */
.lds-dual-ring {
  width: 36px;
  height: 36px;
  margin: 12px auto 0;
}

.lds-dual-ring:after {
  content: " ";
  display: block;
  width: 28px;
  height: 28px;
  margin: 4px;
  border-radius: 50%;
  border: 3px solid #a50000;
  border-color: #a50000 transparent #a50000 transparent;
  animation: lds-dual-ring 1.1s linear infinite;
}

.lds-dual-ring[hidden] {
  display: none !important;
}

@keyframes lds-dual-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* —— Thank you —— */
.ty-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ty-wrap {
  text-align: center;
  color: #fff;
  max-width: 420px;
  width: 100%;
}

.ty-logo {
  max-width: 180px;
  margin-bottom: 20px;
  mix-blend-mode: screen;
}

.ty-wrap h2 {
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 800;
}

.ty-wrap p {
  margin: 0;
  opacity: 0.95;
}

.ty-timer {
  font-size: 42px;
  font-weight: 800;
  margin: 16px 0;
}

.ty-wrap .cta-btn {
  background: #fff;
  color: var(--brand-red);
}

/* EN layout tweaks */
html:not(.ar_layout) .sheet-title,
html:not(.ar_layout) .sheet-sub,
html:not(.ar_layout) .rate-line,
html:not(.ar_layout) .pin-hint {
  direction: ltr;
}

html:not(.ar_layout) .tnc-footer .disclaimer {
  text-align: left;
  direction: ltr;
}

@media (min-width: 768px) {
  .hero .carousel,
  .hero .carousel-inner,
  .hero .carousel-item {
    height: 320px;
    max-height: 320px;
  }

  .sheet {
    margin-top: -40px;
    border-radius: 48px;
    padding: 36px 40px 28px;
  }

  .brand img {
    height: 40px;
  }

  .topbar {
    padding: 12px 24px;
  }

  .tnc-footer {
    padding: 24px 32px 40px;
  }
}
