/* ====== Global Reset & Fonts ====== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Base surface */
  --bg: #12161f;
  --surface: #1a2029;
  --surface-2: #212836;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #f2f4f7;
  --text-muted: #8b93a5;
  --text-faint: #5c6577;

  /* Signature accent (used sparingly) */
  --accent: #d9a94c;
  --accent-soft: rgba(217, 169, 76, 0.14);
  --on-accent: #1a1406;

  /* Service colors (flat, brand-accurate) */
  --whatsapp: #25d366;
  --telegram: #229ed9;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.14);

  /* Shape & shadow */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

/* ====== Main Container ====== */
.container {
  width: 100%;
  max-width: 440px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ====== Brand Icon ====== */
.logo-icon {
  width: 64px;
  height: 64px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  color: var(--accent);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

/* ====== Title ====== */
.main-title {
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.5;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 34px;
  line-height: 1.6;
}

/* ====== Buttons Card ====== */
.buttons-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 22px;
  box-shadow: var(--shadow);
}

.card-title {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-title .icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ====== Buttons ====== */
.btn-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Cairo', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  margin-bottom: 12px;
  text-decoration: none;
  color: #ffffff;
}

.btn-contact:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-contact:active {
  transform: translateY(0);
}

.btn-contact:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-whatsapp {
  background: var(--whatsapp);
}

.btn-telegram {
  background: var(--telegram);
}

.btn-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-icon-lg svg {
  width: 30px;
  height: 30px;
  display: block;
}

/* ====== Disabled Button ====== */
.btn-disabled {
  background: var(--surface-2) !important;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  cursor: not-allowed;
}

.btn-disabled:hover {
  transform: none;
  filter: none;
}

.disabled-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  margin-top: 8px;
}

.disabled-badge svg {
  width: 14px;
  height: 14px;
}

/* ====== Loading State ====== */
.loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 18px;
}

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

/* ====== In-App Browser Overlay ====== */
.inapp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  animation: fadeIn 0.3s ease;
  direction: ltr;
  scrollbar-color: var(--accent) transparent;
}

.inapp-overlay::-webkit-scrollbar {
  width: 8px;
}

.inapp-overlay::-webkit-scrollbar-track {
  background: transparent;
}

.inapp-overlay::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 8px;
}

.inapp-box {
  direction: rtl;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  margin: auto;
}

.inapp-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 50%;
}

.inapp-icon svg {
  width: 26px;
  height: 26px;
}

.inapp-title {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.inapp-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 22px;
  line-height: 1.7;
}

.inapp-desc strong {
  color: var(--text);
}

/* Steps */
.steps {
  text-align: right;
  margin-bottom: 22px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--accent);
}

.step-num {
  min-width: 26px;
  height: 26px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-text {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.6;
}

.step-text small {
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.78rem;
  margin-top: 3px;
}

/* Dots illustration */
.dots-demo {
  display: inline-flex;
  gap: 4px;
  margin: 0 5px;
  vertical-align: middle;
}

.dot {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
}

/* Buttons in overlay */
.inapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  margin-bottom: 10px;
}

.inapp-btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* ====== Footer ====== */
.footer {
  margin-top: 22px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ====== Responsive ====== */
@media (max-width: 400px) {
  .main-title { font-size: 1.4rem; }
  .buttons-card { padding: 24px 16px; }
  .btn-contact { font-size: 0.98rem; padding: 15px 18px; }
  .inapp-box { padding: 22px 18px; }
  .inapp-title { font-size: 1.15rem; }
  .inapp-desc { margin-bottom: 16px; font-size: 0.88rem; }
  .step { padding: 10px 12px; margin-bottom: 9px; }
  .step-text { font-size: 0.86rem; }
  .steps { margin-bottom: 16px; }
}

/* ====== Admin Page Styles ====== */
.admin-body {
  background: var(--bg);
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow);
}

.admin-title {
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.admin-title svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.admin-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
  text-align: right;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.form-label svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 0.98rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  direction: ltr;
  text-align: left;
}

.form-input::placeholder {
  color: var(--text-faint);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.toggle-label {
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-label svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-strong);
  border-radius: 28px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  background: var(--on-accent);
  transform: translateX(20px);
}

.btn-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  margin-top: 8px;
}

.btn-save svg {
  width: 18px;
  height: 18px;
}

.btn-save:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.status-msg {
  text-align: center;
  margin-top: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  display: none;
}

.status-success {
  background: rgba(37, 211, 102, 0.14);
  color: var(--whatsapp);
}

.status-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent);
}
