* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  color: #2b2b2b;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255,255,255,0.95), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(255,255,255,0.85), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.45), transparent 70%),
    linear-gradient(145deg, #faf8f4 0%, #efede7 45%, #e6e2da 100%);
  background-attachment: fixed;
}

/* ---------- Top navigation ---------- */
.topnav {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 8px 24px rgba(80,70,50,0.08);
  backdrop-filter: blur(8px);
}
.topnav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  color: #4a4a4a;
  transition: .2s;
}
.topnav a:hover { background: rgba(0,0,0,0.04); }
.topnav a.active {
  background: linear-gradient(180deg, #00c896 0%, #00a87c 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,179,134,0.3);
}
.topnav a.active.access {
  background: linear-gradient(180deg, #004a8f 0%, #003366 100%);
  box-shadow: 0 4px 12px rgba(0,51,102,0.3);
}

/* ---------- Cards ---------- */
.preview-container,
.form-container {
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 22px;
  padding: 32px 30px;
  width: 100%;
  max-width: 720px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 2px 4px rgba(80,70,50,0.04),
    0 14px 30px rgba(80,70,50,0.09),
    0 30px 64px rgba(80,70,50,0.07);
  transition: transform .28s ease, box-shadow .28s ease;
}
.preview-container:hover,
.form-container:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 4px 8px rgba(80,70,50,0.05),
    0 20px 40px rgba(80,70,50,0.12),
    0 42px 80px rgba(80,70,50,0.08);
}

h3 {
  margin: 0 0 18px;
  font-size: 17px;
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h3 i { font-size: 15px; }

/* ---------- Canvas ---------- */
canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid #eceae4;
  box-shadow:
    0 2px 6px rgba(80,70,50,0.05),
    0 10px 24px rgba(80,70,50,0.07);
  background: #fff;
}

/* ---------- Buttons ---------- */
.button-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  transition: .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn i { font-size: 14px; }

.btn-primary {
  background: linear-gradient(180deg, #00c896 0%, #00a87c 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.28) inset, 0 6px 16px rgba(0,179,134,0.35);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #00d4a0 0%, #00b386 100%);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.28) inset, 0 12px 24px rgba(0,179,134,0.42);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f4f1ea 100%);
  color: #007a5a;
  border: 1px solid #dcece5;
  box-shadow: 0 1px 0 rgba(255,255,255,0.95) inset, 0 6px 16px rgba(80,70,50,0.10);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e8f6f0 100%);
  transform: translateY(-2px);
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinning i { animation: spin .65s linear; }

/* ---------- Access theme overrides ---------- */
body.access h3 { color: #003366; }
body.access h3 i { color: #e87722; }
body.access .btn-primary {
  background: linear-gradient(180deg, #004a8f 0%, #003366 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.28) inset, 0 6px 16px rgba(0,51,102,0.35);
}
body.access .btn-primary:hover {
  background: linear-gradient(180deg, #0056a8 0%, #003f7a 100%);
}
body.access .btn-secondary { color: #003366; border-color: #d0dce8; }
body.access .btn-secondary:hover { background: #e8f0f8; color: #e87722; }
body.access label { color: #003366; }
body.access input:focus,
body.access select:focus {
  border-color: #e87722;
  box-shadow: 0 0 0 4px rgba(232,119,34,0.14);
}

/* ---------- Form — single-column block layout ---------- */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.form-container h3 {
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 2px solid #eee;
}
.form-group { margin-bottom: 0; }

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: .2px;
  color: #4a4a4a;
}
input, select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e3ded4;
  border-radius: 12px;
  font-size: 14.5px;
  background: #fdfcfa;
  color: #2b2b2b;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
  transition: .2s;
  font-family: inherit;
}
input:hover, select:hover { border-color: #d3cdc0; background: #fff; }
input:focus, select:focus {
  outline: none;
  border-color: #00b386;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,179,134,0.14);
}

/* ---------- Verification panel ---------- */
.verify-panel {
  padding: 20px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7fbf9 0%, #eef7f2 100%);
  border: 1px dashed #b9dfce;
}
.verify-panel > label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #007a5a;
  margin-bottom: 14px;
  font-size: 13px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.verify-panel > label i { font-size: 14px; }

.verify-row {
  display: grid;
  grid-template-columns: 240px 1fr 28px;
  gap: 12px;
  align-items: center;
}
.verify-row select { padding: 13px 14px; }

.ring-loader {
  width: 24px;
  height: 24px;
  border: 3px solid #d8ede4;
  border-top-color: #00b386;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  justify-self: center;
}
.ring-loader.hidden { display: none; }

.verify-status {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.4;
  min-height: 20px;
}
.verify-status .muted  { color: #7a7a7a; }
.verify-status .error  { color: #c0392b; font-weight: 600; }
.verify-status .error i { margin-right: 4px; }

.verify-success {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #007a5a;
  font-weight: 600;
}
.verify-success i { color: #00b386; font-size: 16px; }
.verified-name {
  background: #ffffff;
  border: 1px solid #b9dfce;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #0b6b4d;
  letter-spacing: .3px;
}

.btn-mini {
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  font-family: inherit;
}
.btn-confirm {
  background: linear-gradient(180deg, #00c896 0%, #00a87c 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,179,134,0.32);
}
.btn-confirm:hover { background: linear-gradient(180deg, #00d4a0 0%, #00b386 100%); }
.btn-cancel {
  background: #fff;
  color: #7a7a7a;
  border: 1px solid #e0e0e0;
}
.btn-cancel:hover { background: #f5f5f5; }

/* ---------- WhatsApp Channel Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border-radius: 22px;
  padding: 38px 28px 26px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 20px 60px rgba(20,20,20,0.28),
    0 40px 80px rgba(20,20,20,0.18);
  transform: translateY(40px) scale(0.94);
  opacity: 0;
  transition: transform .38s cubic-bezier(0.34, 1.56, 0.64, 1), opacity .3s ease;
  position: relative;
}
.modal-overlay.show .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #a0a0a0;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: color .15s, background .15s;
  font-family: inherit;
}
.modal-close:hover {
  color: #444;
  background: rgba(0,0,0,0.05);
}
.modal-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 36px;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4); }
  50%      { box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4), 0 0 0 12px rgba(37, 211, 102, 0.14); }
}
.modal-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #1a1a1a;
  letter-spacing: -0.3px;
}
.modal-card p {
  margin: 0 0 24px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #666;
}
.modal-cta {
  width: 100%;
  justify-content: center;
  background: linear-gradient(180deg, #25d366 0%, #128c7e 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 8px 20px rgba(37, 211, 102, 0.35);
  text-decoration: none;
  color: #fff;
  padding: 15px 24px;
}
.modal-cta:hover {
  background: linear-gradient(180deg, #2ee074 0%, #15a191 100%);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 12px 26px rgba(37, 211, 102, 0.42);
}
.modal-later {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: transparent;
  border: none;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: color .15s, background .15s;
  font-family: inherit;
}
.modal-later:hover {
  color: #444;
  background: rgba(0,0,0,0.03);
}

@media (max-width: 650px) {
  body { padding: 24px 14px; }
  .preview-container, .form-container { padding: 22px 18px; border-radius: 18px; }
  .verify-row { grid-template-columns: 1fr 28px; }
  .verify-row select { grid-column: 1 / -1; }
  .btn { flex: 1 1 auto; justify-content: center; }
  .modal-card { padding: 32px 22px 22px; border-radius: 18px; }
  .modal-icon { width: 64px; height: 64px; font-size: 30px; }
  .modal-card h2 { font-size: 20px; }
}