/* DigitalRateCard — Shared Base Styles */

:root {
  --color-primary:    #2563eb;
  --color-primary-dk: #1d4ed8;
  --color-accent:     #16a34a;
  --color-wa:         #25D366;
  --color-wa-dk:      #1da851;
  --color-danger:     #dc2626;
  --color-warn:       #d97706;
  --color-surface:    #ffffff;
  --color-bg:         #f8fafc;
  --color-border:     #e2e8f0;
  --color-text:       #1e293b;
  --color-muted:      #64748b;
  --radius:           10px;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
  --shadow-md:        0 4px 12px rgba(0,0,0,.1);
  --font:             'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Utility ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); font-size: .875rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--color-primary);  color: #fff; }
.btn-primary:hover { background: var(--color-primary-dk); text-decoration: none; }
.btn-success  { background: var(--color-accent); color: #fff; }
.btn-danger   { background: var(--color-danger); color: #fff; }
.btn-wa       { background: var(--color-wa); color: #fff; }
.btn-wa:hover { background: var(--color-wa-dk); text-decoration: none; }
.btn-outline  { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.btn-sm { padding: .4rem .85rem; font-size: .85rem; min-height: 36px; }
.btn-full { width: 100%; }

/* ── Cards ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 1.25rem; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }

/* ── Plan-locked card ── */
.plan-locked { opacity: .75; position: relative; }
.plan-locked .card-body > *:not(.card-title):not(.plan-lock-overlay) {
  pointer-events: none;
  filter: blur(1.5px);
  user-select: none;
}
.plan-lock-overlay {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .82rem;
  color: #78350F;
  margin-bottom: .75rem;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-draft    { background: #f1f5f9; color: #475569; }
.badge-product  { background: #dbeafe; color: #1e40af; }
.badge-service  { background: #ede9fe; color: #5b21b6; }

/* ── Alerts ── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  font-size: .92rem;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--color-accent); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--color-danger); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--color-primary); }
.alert-warn    { background: #fef3c7; color: #92400e; border-left: 4px solid var(--color-warn); }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.form-control {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font);
  background: #fff;
  color: var(--color-text);
  min-height: 44px;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--color-primary); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.5rem; }
.form-hint { font-size: .8rem; color: var(--color-muted); margin-top: .25rem; }
.form-error { font-size: .82rem; color: var(--color-danger); margin-top: .25rem; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
@media (min-width: 600px) { .modal-overlay { align-items: center; } }
.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  animation: slideUp .25s ease;
}
@media (min-width: 600px) { .modal { border-radius: var(--radius); } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.modal-close { float: right; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--color-muted); margin-top: -.25rem; }

/* ── Navbar (public) ── */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { display: flex; align-items: center; text-decoration: none; line-height: 1; }
.navbar-actions { display: flex; gap: .5rem; }

/* ── Page header ── */
.page-hero { padding: 3rem 1rem 2rem; text-align: center; }
.page-hero h1 { font-size: clamp(1.6rem, 5vw, 2.8rem); font-weight: 800; line-height: 1.2; }
.page-hero p { font-size: 1.05rem; color: var(--color-muted); margin-top: .75rem; max-width: 560px; margin-inline: auto; }

/* ── Footer ── */
.footer { background: var(--color-text); color: #94a3b8; padding: 2rem 1rem; text-align: center; font-size: .875rem; margin-top: 4rem; }
.footer a { color: #cbd5e1; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }
