:root {
  --bg: #050805;
  --bg-2: #081009;
  --panel: #0b130d;
  --line: #f0b42933;
  --line-soft: #ffffff14;
  --gold: #f0b429;
  --gold-deep: #c98c1a;
  --pitch: #2f6b47;
  --pitch-bright: #4caf6f;
  --white: #f6f4ee;
  --muted: #a8ab9f;
  --danger: #e5533d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--white);
  background:
    radial-gradient(ellipse 900px 500px at 50% -8%, #142918 0%, transparent 60%),
    radial-gradient(ellipse 700px 400px at 90% 15%, #1a1206 0%, transparent 55%),
    var(--bg);
  font-family: 'Tajawal', Tahoma, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 118px,
    #ffffff08 118px,
    #ffffff08 119px
  );
  mask-image: radial-gradient(ellipse 60% 40% at 50% 0%, #000 0%, transparent 70%);
}

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

.wrap {
  width: min(680px, 92%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 36px 0 18px;
}

.logo-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.logo-img {
  display: block;
  height: clamp(96px, 16vw, 148px);
  width: auto;
}

.logo-text {
  direction: ltr;
  display: none;
  font-weight: 900;
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: 0.5px;
  color: var(--gold);
}

.intro-text {
  text-align: center;
  margin-bottom: 26px;
}

.intro-text h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4.6vw, 40px);
  font-weight: 900;
  line-height: 1.2;
}

.intro-text h1 em {
  font-style: normal;
  color: var(--gold);
}

.intro-text .lead {
  margin: 0 auto;
  max-width: 500px;
  color: var(--muted);
  font-size: clamp(14.5px, 2vw, 17px);
}

/* Activation Card */
.activation-card {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, #0d1710f0, #060906f5);
  box-shadow: 0 24px 50px -20px #000a, inset 0 1px 0 #ffffff0a;
}

.activation-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.code-input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  color: var(--gold);
  font-family: 'Tajawal', monospace;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
  direction: ltr;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.code-input::placeholder {
  color: #6d7069;
  letter-spacing: 2px;
  font-size: 16px;
  font-weight: 500;
}

.code-input:focus {
  border-color: var(--gold);
  background: #0f1a12;
}

.btn-activate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(95deg, var(--gold-deep), var(--gold) 55%, var(--gold-deep));
  color: #0a0a05;
  font-family: 'Tajawal', sans-serif;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-activate:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-activate:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid #0a0a0540;
  border-top-color: #0a0a05;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-activate.loading .spinner {
  display: inline-block;
}

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

/* Alert Box */
.alert {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.alert.show {
  display: block;
}

.alert.error {
  border: 1px solid #e5533d55;
  background: #e5533d14;
  color: #ff8e7d;
}

/* Subscription Result Card */
.result-card {
  display: none;
  margin-top: 24px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(76, 175, 111, 0.35);
  background: var(--panel);
}

.result-card.show {
  display: block;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--pitch-bright);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pitch-bright);
}

.duration-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: #f0b4291a;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.info-grid {
  display: grid;
  gap: 12px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
}

.info-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.info-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.info-value {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--white);
  direction: ltr;
  text-align: right;
  word-break: break-all;
}

.info-value.highlight {
  color: var(--gold);
}

.info-ltr {
  text-align: left;
  font-size: 13.5px;
}

.info-pre {
  margin: 4px 0 0;
  font-family: 'Tajawal', monospace;
  white-space: pre-line;
  text-align: left;
  line-height: 1.65;
  font-size: 14.5px;
}

.btn-copy {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #f0b42914;
  color: var(--gold);
  font-family: 'Tajawal', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-copy:hover,
.btn-copy.copied {
  background: var(--gold);
  color: #050805;
}

.dates-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

footer {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  padding: 20px 0 28px;
  color: #6d7069;
  font-size: 12.5px;
}

@media (max-width: 560px) {
  .dates-row {
    grid-template-columns: 1fr;
  }
  .info-row {
    flex-wrap: wrap;
  }
}
