/* ═══════════════════════════════════════════════════════════════
   Electrik.NG — Design System  (shared across all pages)
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --blue:      #1A56A0;
  --blue-d:    #154A8A;
  --blue-l:    #EFF6FF;
  --blue-m:    #BFDBFE;
  --teal:      #0E7C7B;
  --teal-l:    #CCFBF1;
  --green:     #059669;
  --green-l:   #D1FAE5;
  --green-m:   #6EE7B7;
  --amber:     #D97706;
  --amber-l:   #FFFBEB;
  --amber-m:   #FDE68A;
  --red:       #DC2626;
  --red-l:     #FEF2F2;
  --red-m:     #FECACA;
  --gray-900:  #111827;
  --gray-800:  #1F2937;
  --gray-700:  #374151;
  --gray-600:  #4B5563;
  --gray-500:  #6B7280;
  --gray-400:  #9CA3AF;
  --gray-300:  #D1D5DB;
  --gray-200:  #E5E7EB;
  --gray-100:  #F3F4F6;
  --border:    #E5E7EB;
  --border-in: #D1D5DB;
  --white:     #FFFFFF;
  --surface:   #F9FAFB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.08);
  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --font:      'Plus Jakarta Sans', sans-serif;
  --font-h:    'Sora', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --ease:      150ms ease-out;
  --wa:        #25D366;
  --wa-d:      #128C4E;
  --wa-l:      #E9FDF0;
  --wa-m:      #A7F3C8;
  --teal-m:    #99F6E4;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--gray-700); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--blue-m); border-radius: 3px; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-h); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: .9rem;
  border-radius: var(--radius); transition: all var(--ease);
  cursor: pointer; border: none; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; padding: 0 24px; height: 44px; }
.btn-primary:hover { background: var(--blue-d); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,86,160,.35); }
.btn-secondary { background: transparent; color: var(--blue); padding: 0 22px; height: 44px; border: 1.5px solid var(--blue-m); }
.btn-secondary:hover { background: var(--blue-l); border-color: var(--blue); }
.btn-amber { background: var(--amber); color: #fff; padding: 0 24px; height: 44px; }
.btn-amber:hover { background: #B45309; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(217,119,6,.35); }
.btn-ghost { background: transparent; color: var(--gray-700); padding: 0 16px; height: 40px; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { height: 36px; padding: 0 16px; font-size: .84rem; }
.btn-lg { height: 52px; padding: 0 32px; font-size: 1rem; border-radius: 10px; }
.btn-danger { background: var(--red-l); color: var(--red); padding: 0 20px; height: 40px; border: 1px solid var(--red-m); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ── Submit button ── */
.btn-submit {
  width: 100%; height: 48px; background: var(--blue); color: #fff;
  border-radius: 8px; font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
  position: relative; overflow: hidden; cursor: pointer;
}
.btn-submit:hover:not(:disabled) { background: var(--blue-d); box-shadow: 0 6px 20px rgba(26,86,160,.3); transform: translateY(-1px); }
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { opacity: .55; cursor: not-allowed; }
.btn-text { transition: opacity .2s; }
.btn-spinner { position: absolute; display: none; }
.btn-submit.loading .btn-text { opacity: 0; }
.btn-submit.loading .btn-spinner { display: flex; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: .72rem; font-weight: 700; }
.badge-success  { background: var(--green-l); color: #065F46; }
.badge-pending  { background: var(--amber-l); color: #92400E; }
.badge-failed   { background: var(--red-l);   color: #991B1B; }
.badge-reversed { background: var(--gray-100); color: var(--gray-600); }
.badge-blue     { background: var(--blue-l);  color: var(--blue); border: 1px solid var(--blue-m); }
.badge-prepaid  { background: var(--blue-l);  color: var(--blue); }
.badge-postpaid { background: var(--amber-l); color: #92400E; }
.badge-processing { background: var(--teal-l); color: var(--teal); }

/* ── Status dot ── */
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(5,150,105,.2); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1;box-shadow:0 0 0 3px rgba(5,150,105,.2)}50%{opacity:.7;box-shadow:0 0 0 5px rgba(5,150,105,.1)} }

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--gray-700); }
.input-wrap { position: relative; }
.input-icon-l { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); pointer-events: none; display: flex; }
.input-icon-r { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); display: flex; cursor: pointer; background: none; border: none; padding: 0; transition: color var(--ease); }
.input-icon-r:hover { color: var(--gray-700); }
.input {
  width: 100%; height: 44px; border: 1.5px solid var(--border-in);
  border-radius: 8px; padding: 0 40px; font-size: .9rem;
  color: var(--gray-900); background: var(--white);
  transition: border-color var(--ease), box-shadow var(--ease); outline: none; font-family: var(--font);
}
.input::placeholder { color: var(--gray-400); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,160,.1); }
.input.error { border-color: var(--red); }
.input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.input-no-icon { padding: 0 14px; }
.field-hint { font-size: .76rem; color: var(--gray-400); }
.field-error { font-size: .76rem; color: var(--red); display: none; }
.field-error.show,
.field-error.field-validation-error { display: block; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }

/* ── Alerts ── */
.alert { border-radius: 10px; padding: 12px 14px; font-size: .84rem; margin-bottom: 18px; display: none; align-items: flex-start; gap: 10px; line-height: 1.5; }
.alert.show { display: flex; }
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-danger    { background: var(--red-l);   border: 1px solid var(--red-m);   color: #991B1B; }
.alert-warning   { background: var(--amber-l); border: 1px solid var(--amber-m); color: #92400E; }
.alert-info      { background: var(--blue-l);  border: 1px solid var(--blue-m);  color: #1E40AF; }
.alert-success   { background: var(--green-l); border: 1px solid var(--green-m); color: #065F46; }
.alert-credentials { background: var(--red-l);   border: 1px solid var(--red-m);   color: #991B1B; }
.alert-locked    { background: var(--amber-l); border: 1px solid var(--amber-m); color: #92400E; }
.alert-unverified{ background: var(--blue-l);  border: 1px solid var(--blue-m);  color: #1E40AF; }
.alert strong { font-weight: 700; display: block; margin-bottom: 2px; }
.alert a { font-weight: 700; text-decoration: underline; }

/* ── Divider ── */
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: .76rem; color: var(--gray-400); }

/* ── Card base ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.card-title-sm { font-size: .9rem; font-weight: 700; color: var(--gray-900); }
.card-link { font-size: .8rem; font-weight: 600; color: var(--blue); display: flex; align-items: center; gap: 4px; transition: opacity var(--ease); }
.card-link:hover { opacity: .7; }
.card-footer-link { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px; border-top: 1px solid var(--border); font-size: .84rem; font-weight: 600; color: var(--blue); transition: background var(--ease); }
.card-footer-link:hover { background: var(--blue-l); }

/* ── Empty state ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }
.empty-title { font-size: .95rem; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.empty-sub { font-size: .83rem; color: var(--gray-400); line-height: 1.6; max-width: 220px; }
.empty-cta { margin-top: 16px; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; background: var(--blue); color: #fff; border-radius: 8px; font-size: .84rem; font-weight: 700; transition: all var(--ease); }
.empty-cta:hover { background: var(--blue-d); }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; font-size: .88rem; max-width: 320px; transform: translateX(120%); transition: transform .35s cubic-bezier(.22,1,.36,1); z-index: 200; }
.toast.show { transform: translateX(0); }
.toast-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--green-l); color: var(--green); }
.toast-text strong { display: block; font-weight: 700; color: var(--gray-900); font-size: .85rem; }
.toast-text span { font-size: .78rem; color: var(--gray-400); }

/* ── Skeleton loader ── */
.skeleton { background: linear-gradient(90deg,var(--gray-100) 25%,var(--gray-200) 50%,var(--gray-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0%{background-position:200% 0}100%{background-position:-200% 0} }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 20px 0 4px; }
.page-btn { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: .84rem; font-weight: 600; color: var(--gray-500); background: transparent; border: 1px solid var(--border); transition: all var(--ease); cursor: pointer; }
.page-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Utility ── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
