/* ═══════════════════════════════════════════════════════
   OWFR eReferral & eConsult – Stylesheet
   Plugin: owfr-ereferral-econsult
   ═══════════════════════════════════════════════════════ */

/* ── Reset Divi/Weebly defaults ── */
.owfr-erc *,
.owfr-erc *::before,
.owfr-erc *::after { box-sizing: border-box; }
.owfr-erc h1,.owfr-erc h2,.owfr-erc h3,.owfr-erc h4,.owfr-erc h5,.owfr-erc h6 {
  font-size: inherit !important; font-weight: inherit !important;
  line-height: inherit !important; margin: 0 !important; padding: 0 !important;
  letter-spacing: normal !important; text-transform: none !important; color: inherit !important;
}
.owfr-erc { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; margin: 0 auto; max-width: 100%; padding: 0; }
.owfr-erc a { text-decoration: none; }
.owfr-erc-inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ── Hero Banner ── */
.owfr-erc-hero {
  position: relative; color: #fff; min-height: 220px; overflow: hidden;
}
.owfr-erc-hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.owfr-erc-hero-bg img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.owfr-erc-hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,77,45,0.88) 0%, rgba(0,107,63,0.78) 100%);
}
.owfr-erc-hero-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 2.5rem; min-height: 220px;
}
.owfr-erc-hero-text { max-width: 60ch; }
.owfr-erc-hero-text h2 {
  font-size: 1.5rem !important; font-weight: 700 !important; line-height: 1.25 !important;
  color: #fff !important; margin: 0 0 0.5rem 0 !important; padding: 0 !important;
  letter-spacing: -0.01em !important; text-transform: none !important;
}
.owfr-erc-hero-text p {
  margin: 0 !important; font-size: 0.9rem !important; line-height: 1.55 !important;
  color: rgba(255,255,255,0.92) !important;
}
.owfr-erc-hero-badge {
  display: inline-block; background: rgba(255,255,255,0.2); color: #fff;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 0.3rem 0.7rem; border-radius: 20px; margin-bottom: 0.6rem;
}

/* ── Instructions ── */
.owfr-erc-intro {
  background: #f8faf9; border-bottom: 1px solid rgba(0,107,63,0.12);
  padding: 1.5rem 0; margin-bottom: 0;
}
.owfr-erc-intro-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1rem;
  display: flex; align-items: flex-start; gap: 1rem;
}
.owfr-erc-intro-icon {
  flex-shrink: 0; width: 40px; height: 40px; background: rgba(0,107,63,0.1);
  border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.owfr-erc-intro-icon svg { width: 22px; height: 22px; color: #006B3F; }
.owfr-erc-intro h3 { font-size: 1rem !important; font-weight: 700 !important; color: #006B3F !important; margin: 0 0 0.35rem 0 !important; }
.owfr-erc-intro p { font-size: 0.9rem !important; line-height: 1.55 !important; color: #444 !important; margin: 0 !important; }

/* ── Tab Navigation ── */
.owfr-erc-tabs-wrap {
  background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100;
  margin-bottom: 2rem;
}
.owfr-erc-tabs {
  display: flex; align-items: center; justify-content: center; gap: 0; margin: 0 auto; padding: 0; list-style: none;
  max-width: 1200px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.owfr-erc-tabs li { list-style: none; margin: 0; padding: 0; }
.owfr-erc-tabs::-webkit-scrollbar { display: none; }
.owfr-erc-tab {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 1rem 1.4rem; flex: 1; min-width: 0;
  font-size: 0.88rem; font-weight: 600; color: #555; white-space: nowrap;
  border: none; border-bottom: 3px solid transparent; background: none;
  font-family: inherit; cursor: pointer; transition: all 0.15s ease; text-align: center;
}
.owfr-erc-tab:hover { color: #006B3F; background: rgba(0,107,63,0.04); }
.owfr-erc-tab.active { color: #006B3F; border-bottom-color: #006B3F; background: rgba(0,107,63,0.05); }
.owfr-erc-tab svg { width: 22px; height: 22px; flex-shrink: 0; opacity: 0.6; }
.owfr-erc-tab.active svg { opacity: 1; }

/* ── Tab Panels ── */
.owfr-erc-panel { display: none; animation: owfrErcFadeIn 0.25s ease; }
.owfr-erc-panel.active { display: block; }
@keyframes owfrErcFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Section Header ── */
.owfr-erc-section-header {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; padding-bottom: 0.85rem;
  border-bottom: 3px solid; border-image: linear-gradient(90deg, #006B3F 0%, rgba(0,107,63,0.08) 100%) 1;
}
.owfr-erc-section-header svg { width: 26px; height: 26px; flex-shrink: 0; color: #006B3F; }
.owfr-erc-section-title {
  font-size: 1.35rem !important; font-weight: 800 !important; color: #006B3F !important;
  line-height: 1.25 !important; letter-spacing: -0.01em !important;
}
.owfr-erc-section-sub { font-size: 0.88rem; color: #555; font-weight: 400; margin-left: 0.15rem; }

/* ── Card Grid ── */
.owfr-erc-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.25rem;
}

/* ── Video Wrapper ── */
.owfr-erc-video-wrapper {
  grid-column: span 12; border-radius: 12px; overflow: hidden;
  background: #000; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.owfr-erc-video-responsive {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
}
.owfr-erc-video-responsive iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* ── Cards ── */
.owfr-erc-card {
  grid-column: span 12; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px;
  overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; transition: box-shadow 0.2s ease;
  position: relative;
}
.owfr-erc-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.owfr-erc-card-content {
  padding: 1.25rem; display: flex; flex-direction: column; flex: 1;
}
.owfr-erc-card-logo {
  width: 100%; height: 80px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.85rem; padding-bottom: 0.85rem; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.owfr-erc-card-logo img { max-width: 160px; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.owfr-erc-card-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.5rem; }
.owfr-erc-card h3 { font-size: 0.95rem !important; font-weight: 700 !important; line-height: 1.3 !important; color: #006B3F !important; }
.owfr-erc-tagline { margin: 0.2rem 0 0 0; font-size: 0.85rem; line-height: 1.4; color: #444; }
.owfr-erc-card-body { flex: 1; margin-bottom: 0.75rem; }
.owfr-erc-small { font-size: 0.85rem; line-height: 1.5; margin: 0.35rem 0 0 0; color: #333; }
.owfr-erc-meta {
  margin: 0.5rem 0 0 0; padding: 0.65rem 0.75rem; border-radius: 8px;
  background: rgba(0,107,63,0.04); border-left: 3px solid #006B3F;
}
.owfr-erc-meta strong { display: inline-block; margin-right: 0.25rem; }
.owfr-erc-bullets {
  margin: 0.35rem 0 0 1.25rem; padding: 0; font-size: 0.85rem; line-height: 1.6; color: #333;
}

/* ── Buttons ── */
.owfr-erc-actions {
  display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto; align-items: stretch; width: 100%;
}
.owfr-erc-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.25rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.18);
  text-decoration: none !important; font-weight: 600; font-family: inherit;
  font-size: 0.85rem; line-height: 1; text-align: center; cursor: pointer; transition: all 0.15s ease;
}
.owfr-erc-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.owfr-erc-btn-primary { background: #006B3F; color: #fff !important; border-color: #006B3F; }
.owfr-erc-btn-primary:hover { background: #005a34; }
.owfr-erc-btn-secondary { background: #fff; color: #006B3F !important; border-color: #006B3F; }
.owfr-erc-btn-secondary:hover { background: #f0f8f4; }

.owfr-erc-email-link { color: #006B3F; font-weight: 600; }
.owfr-erc-divider { height: 1px; background: rgba(0,0,0,0.08); margin: 1rem 0; }

/* ── Tips Intro Banner ── */
.owfr-erc-tips-intro {
  grid-column: span 12; display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem 1.5rem; border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px; background: #f0f8f4;
}
.owfr-erc-tips-intro img {
  max-width: 140px; max-height: 70px; width: auto; height: auto;
  object-fit: contain; flex-shrink: 0;
}
.owfr-erc-tips-intro p {
  margin: 0; font-size: 0.88rem; line-height: 1.55; color: #333;
}

/* ── Layout variants ── */
.owfr-erc-card-wide { grid-column: span 12; }
.owfr-erc-card-half { grid-column: span 12; }

/* ── Responsive ── */
@media (min-width: 640px) {
  .owfr-erc-card-half { grid-column: span 6; }
}
@media (min-width: 860px) {
  .owfr-erc-card { grid-column: span 4; }
  .owfr-erc-card-wide { grid-column: span 12; }
  .owfr-erc-card-half { grid-column: span 6; }
}
@media (max-width: 639px) {
  .owfr-erc-hero-inner { padding: 1.75rem 1.5rem; min-height: 180px; }
  .owfr-erc-hero-text h2 { font-size: 1.25rem !important; }
  .owfr-erc-tab { padding: 0.7rem 0.6rem; font-size: 0.72rem; }
  .owfr-erc-tab svg { width: 18px; height: 18px; }
  .owfr-erc-section-title { font-size: 1.15rem !important; }
  .owfr-erc-intro-inner { flex-direction: column; gap: 0.6rem; }
  .owfr-erc-tips-intro { flex-direction: column; text-align: center; }
}

/* ── Admin edit button ── */
.owfr-erc-admin-edit-btn {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; background: #006B3F; color: #fff;
  border: 2px solid #fff; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  opacity: 0; transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25); font-family: inherit; line-height: 1.3;
}
.owfr-erc-card:hover .owfr-erc-admin-edit-btn,
.owfr-erc-admin-edit-btn:focus { opacity: 1; }
.owfr-erc-admin-delete-btn {
  position: absolute; top: 10px; right: 80px; z-index: 10;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; background: #c00; color: #fff;
  border: 2px solid #fff; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  opacity: 0; transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25); font-family: inherit; line-height: 1.3;
}
.owfr-erc-card:hover .owfr-erc-admin-delete-btn,
.owfr-erc-admin-delete-btn:focus { opacity: 1; }

/* ── Add Card Button (admin only) ── */
.owfr-erc-admin-add-card {
  grid-column: span 12; border: 2px dashed rgba(0,107,63,0.3); border-radius: 12px;
  background: rgba(0,107,63,0.03); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem;
  padding: 2rem 1rem; cursor: pointer; transition: all 0.2s ease;
  min-height: 140px; font-family: inherit;
}
.owfr-erc-admin-add-card:hover {
  border-color: #006B3F; background: rgba(0,107,63,0.07);
  box-shadow: 0 2px 12px rgba(0,107,63,0.12);
}
.owfr-erc-admin-add-card svg { width: 32px; height: 32px; color: #006B3F; opacity: 0.6; }
.owfr-erc-admin-add-card:hover svg { opacity: 1; }
.owfr-erc-admin-add-card span { font-size: 0.9rem; font-weight: 600; color: #006B3F; opacity: 0.7; }
.owfr-erc-admin-add-card:hover span { opacity: 1; }

/* ── Add Video Button (admin only) ── */
.owfr-erc-admin-add-video {
  grid-column: span 12; border: 2px dashed rgba(0,80,200,0.25); border-radius: 12px;
  background: rgba(0,80,200,0.03); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.5rem;
  padding: 1.25rem 1rem; cursor: pointer; transition: all 0.2s ease;
  min-height: 80px; font-family: inherit;
}
.owfr-erc-admin-add-video:hover {
  border-color: rgba(0,80,200,0.55); background: rgba(0,80,200,0.07);
  box-shadow: 0 2px 12px rgba(0,80,200,0.10);
}
.owfr-erc-admin-add-video svg { width: 26px; height: 26px; color: #0050c8; opacity: 0.6; }
.owfr-erc-admin-add-video:hover svg { opacity: 1; }
.owfr-erc-admin-add-video span { font-size: 0.85rem; font-weight: 600; color: #0050c8; opacity: 0.7; }
.owfr-erc-admin-add-video:hover span { opacity: 1; }

/* ── Admin video block (deletable wrapper) ── */
.owfr-erc-video-admin-wrap {
  grid-column: span 12; position: relative;
}
.owfr-erc-video-admin-wrap:hover .owfr-erc-admin-delete-video { opacity: 1; }
.owfr-erc-admin-delete-video {
  position: absolute; top: 8px; right: 8px; z-index: 20;
  background: #c0392b; color: #fff; border: none; border-radius: 6px;
  padding: 0.3rem 0.7rem; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; font-family: inherit; opacity: 0;
  transition: opacity 0.2s; line-height: 1.4;
}
.owfr-erc-admin-delete-video:hover { background: #a93226; }

/* ── Layout selector in modal ── */
.owfr-erc-layout-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.3rem; }
.owfr-erc-layout-opt {
  padding: 0.4rem 0.8rem; border: 2px solid #ddd; border-radius: 6px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; background: #fff;
  font-family: inherit; transition: all 0.15s; color: #555;
}
.owfr-erc-layout-opt:hover { border-color: #006B3F; color: #006B3F; }
.owfr-erc-layout-opt.selected { border-color: #006B3F; background: rgba(0,107,63,0.08); color: #006B3F; }

/* ── Custom tab management ── */
.owfr-erc-add-tab-li { display: flex; align-items: center; }
.owfr-erc-admin-add-tab {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 2px dashed rgba(0,107,63,0.4);
  background: transparent; color: #006B3F; cursor: pointer;
  transition: all 0.2s; margin: 0 0.5rem; flex-shrink: 0;
}
.owfr-erc-admin-add-tab:hover { border-color: #006B3F; background: rgba(0,107,63,0.08); }
.owfr-erc-admin-add-tab svg { width: 18px; height: 18px; }
.owfr-erc-tab-custom { position: relative; padding-right: 22px !important; }
.owfr-erc-admin-delete-tab {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  display: none; align-items: center; justify-content: center;
  background: #c00; color: #fff; border-radius: 50%; font-size: 13px; line-height: 1;
  cursor: pointer; z-index: 5;
}
.owfr-erc-tab-custom:hover .owfr-erc-admin-delete-tab { display: flex; }
.owfr-erc-icon-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.owfr-erc-icon-opt {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #ddd; border-radius: 8px; background: #fff; cursor: pointer;
  transition: all 0.15s; padding: 6px;
}
.owfr-erc-icon-opt svg { width: 22px; height: 22px; color: #555; }
.owfr-erc-icon-opt:hover { border-color: #006B3F; }
.owfr-erc-icon-opt:hover svg { color: #006B3F; }
.owfr-erc-icon-opt.selected { border-color: #006B3F; background: rgba(0,107,63,0.08); }
.owfr-erc-icon-opt.selected svg { color: #006B3F; }

/* ── Drag-and-Drop (admin only) ── */
.owfr-erc-drag-handle {
  position: absolute; top: 10px; left: 10px; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0,107,63,0.9); color: #fff;
  border: 2px solid #fff; cursor: grab;
  opacity: 0; transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.owfr-erc-drag-handle:active { cursor: grabbing; }
.owfr-erc-card:hover .owfr-erc-drag-handle,
.owfr-erc-drag-handle:focus { opacity: 1; }
.owfr-erc-drag-handle svg { width: 18px; height: 18px; pointer-events: none; }
.owfr-erc-card.owfr-erc-dragging {
  opacity: 0.35; transform: scale(0.97);
  box-shadow: 0 0 0 2px #006B3F; border-style: dashed;
}

/* ── Inline edit modal ── */
.owfr-erc-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center;
}
.owfr-erc-modal.open { display: flex; }
.owfr-erc-modal-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.owfr-erc-modal-panel {
  position: relative; background: #fff; border-radius: 14px;
  width: 560px; max-width: 95vw; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.owfr-erc-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid #e0e0e0;
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 14px 14px 0 0;
}
.owfr-erc-modal-header h2 {
  margin: 0; font-size: 1.1rem; font-weight: 700; color: #006B3F;
}
.owfr-erc-modal-close {
  background: none; border: none; font-size: 1.5rem; color: #999;
  cursor: pointer; padding: 0.25rem; line-height: 1;
}
.owfr-erc-modal-close:hover { color: #333; }
.owfr-erc-modal-body { padding: 1.5rem; }
.owfr-erc-edit-field { margin-bottom: 1rem; }
.owfr-erc-edit-field label {
  display: block; font-size: 0.82rem; font-weight: 600; color: #444; margin-bottom: 0.3rem;
}
.owfr-erc-edit-field input[type="text"],
.owfr-erc-edit-field input[type="url"],
.owfr-erc-edit-field textarea {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #ddd; border-radius: 6px;
  font-size: 0.88rem; font-family: inherit; transition: border-color 0.15s;
}
.owfr-erc-edit-field input:focus,
.owfr-erc-edit-field textarea:focus {
  border-color: #006B3F; outline: none; box-shadow: 0 0 0 2px rgba(0,107,63,0.15);
}
.owfr-erc-modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid #e0e0e0;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  position: sticky; bottom: 0; background: #fff; border-radius: 0 0 14px 14px;
}
.owfr-erc-save-status { font-size: 0.85rem; color: #006B3F; font-weight: 600; }
.owfr-erc-btn-save {
  background: #006B3F; color: #fff; border: none; border-radius: 6px;
  padding: 0.6rem 1.5rem; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.owfr-erc-btn-save:hover { background: #005a34; }
.owfr-erc-btn-cancel {
  background: #fff; color: #555; border: 1px solid #ddd; border-radius: 6px;
  padding: 0.6rem 1.25rem; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.owfr-erc-btn-cancel:hover { background: #f5f5f5; }
.owfr-erc-btn-repeater-add {
  background: none; border: 1px dashed #006B3F; color: #006B3F; border-radius: 6px;
  padding: 0.4rem 1rem; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  font-family: inherit; margin-top: 0.35rem;
}
.owfr-erc-btn-row { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.5rem; }
.owfr-erc-btn-row .owfr-erc-edit-field { flex: 1; margin-bottom: 0; }
.owfr-erc-btn-row-del {
  background: none; border: none; color: #c00; font-size: 1.2rem;
  cursor: pointer; padding: 0.35rem; line-height: 1; align-self: flex-end;
}
.owfr-erc-img-preview {
  max-height: 50px; margin-top: 0.4rem; border-radius: 4px; border: 1px solid #eee; display: none;
}
.owfr-erc-media-pick {
  white-space: nowrap; padding: 0.4rem 0.7rem; font-size: 0.82rem;
}
