/* PowerMindLab Partners – Portal Styles
 * Adapted to match PowerMindLab design system tokens and component feel.
 * Scope: ONLY within .pmlp-portal / .pmlp-bg to avoid site-wide leakage.
 */

/* =========================================
   DESIGN TOKENS (scoped)
   ========================================= */
.pmlp-portal{
  --pml-color-bg:#0D0D0D;
  --pml-color-bg-elevated:#161616;
  --pml-color-card:#151515;
  --pml-color-accent:#DA2B35;
  --pml-color-text:#F5F5F5;
  --pml-color-text-soft:#DEDEE5;
  --pml-color-text-muted:#8E8E99;
  --pml-color-border-subtle:#2D2D2D;

  --pml-radius-xl:20px;
  --pml-radius-pill:100px;

  --pml-font-size-xs:12px;
  --pml-font-size-sm:13px;
  --pml-font-size-md:15px;
  --pml-font-size-lg:18px;

  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--pml-color-text);
}

.pmlp-portal h1{
  margin: 0 0 10px 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}
@media only screen and (max-width: 720px){
  .pmlp-portal h1{
    font-size: 20px;
    line-height: 1.2;
  }
}
@media only screen and (min-width: 720px){
  .pmlp-portal h2{ font-size: 18px; line-height: 1.25; }
  .pmlp-portal h3{ font-size: 15px; line-height: 1.25; }
}
@media only screen and (max-width: 720px){
  .pmlp-portal h2{ font-size: 16px; line-height: 1.25; }
  .pmlp-portal h3{ font-size: 14px; line-height: 1.25; }
}


/* Outer shell for portal pages */
.pmlp-bg{
  background: var(--pml-color-bg);
  border: 1px solid var(--pml-color-border-subtle);
  border-radius: var(--pml-radius-xl);
  padding: 22px 18px 26px;
  box-sizing: border-box;
}

/* Brand / title */
.pmlp-brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pmlp-brand h1,
.pmlp-brand h2,
.pmlp-brand h3{
  margin:0;
  color: #fff;
  font-weight: 700;
  line-height: 1.1;
}
.pmlp-brand p{
  margin:4px 0 0;
  color: var(--pml-color-text-muted);
  font-size: 14px;
}

/* Responsive heading sizing (mirrors dashboard/stats patterns) */
@media only screen and (max-width: 720px){
  .pmlp-bg .pmlp-bg h2{ font-size: 14px; }
  .pmlp-bg h3{ font-size: 12px; }
}
@media only screen and (min-width: 720px){
  .pmlp-bg h1{ font-size: 28px; }
  .pmlp-bg h2{ font-size: 20px; }
  .pmlp-bg h3{ font-size: 16px; }
}

/* =========================================
   CARDS / NOTES
   ========================================= */
.pmlp-note{
  border-radius: 10px;
  background: var(--pml-color-bg-elevated);
  border: 1px solid var(--pml-color-border-subtle);
  padding: 14px 16px;
  color: var(--pml-color-text-soft);
}
.pmlp-note strong{ color:#fff; }

/* Stat tiles container */
.pmlp-stats{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 18px;
}
@media (min-width: 720px){
  .pmlp-stats{ grid-template-columns: repeat(3, 1fr); }
}

/* Stat tile */
.pmlp-stats .pmlp-note{
  background: var(--pml-color-card);
}

/* =========================================
   GRID (Creatives preview)
   ========================================= */
.pmlp-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 720px){
  .pmlp-grid{ grid-template-columns: repeat(3, 1fr); }
}
.pmlp-creative{
  border-radius: 10px;
  background: var(--pml-color-bg-elevated);
  border: 1px solid var(--pml-color-border-subtle);
  padding: 14px 16px;
  box-sizing: border-box;
}
.pmlp-creative-title{
  margin:0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

/* =========================================
   FORMS
   ========================================= */
.pmlp-form{
  display:flex;
  flex-direction:column;
  gap: 12px;
  margin-top: 12px;
}
.pmlp-row{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.pmlp-stack{ display:flex; flex-direction:column; gap:14px; }
.pmlp-spacer-sm{ height:10px; }

.pmlp-row label{
  font-size: 13px;
  color: var(--pml-color-text-muted);
}
.pmlp-row input[type="text"],
.pmlp-row input[type="email"],
.pmlp-row input[type="password"],
.pmlp-row input[type="url"],
.pmlp-row textarea,
.pmlp-row select{
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--pml-color-border-subtle);
  background: var(--pml-color-bg-elevated);
  color: #fff;
  font-size: 14px;
  padding: 10px 12px;
  box-sizing: border-box;
}
.pmlp-row textarea{
  padding: 12px 14px;
  resize: vertical;
  min-height: 90px;
}
.pmlp-row input::placeholder,
.pmlp-row textarea::placeholder{
  color: var(--pml-color-text-muted);
}

/* =========================================
   BUTTONS (adapted from PML core)
   ========================================= */
.pmlp-actions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pmlp-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: none;
  padding: 8px 18px;
  font-size: var(--pml-font-size-xs);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, background 160ms ease;
}

/* Primary gradient CTA */
.pmlp-btn-primary{
  position: relative;
  z-index: 0;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-width: 130px;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;

  background-color: transparent;
  background-image: linear-gradient(180deg, #DA2B35 0%, #991E25 100%);
  color: #fff !important;

  font-size: var(--pml-font-size-sm);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;

  transition:
    color 300ms cubic-bezier(0.75, 0, 0.45, 1),
    transform 120ms ease-out,
    box-shadow 120ms ease-out;
}
.pmlp-btn-primary::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;

  background-image: linear-gradient(180deg, #991E25 0%, #991E25 100%);
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.75, 0, 0.45, 1);
}
.pmlp-btn-primary:hover::before{ transform: translateX(0); }
.pmlp-btn-primary:hover{ color: #fff !important; }
.pmlp-btn-primary:focus-visible{
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.pmlp-btn-primary:active{
  transform: scale(0.97);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
}
.pmlp-btn-primary[disabled],
.pmlp-btn-primary.is-disabled{
  opacity: 0.45;
  cursor: not-allowed;
}
.pmlp-btn-primary::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  pointer-events:none;
  background-image: linear-gradient(180deg, #991E25 0%, #991E25 100%);
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.75, 0, 0.45, 1);
}
.pmlp-btn-primary > *{ position: relative; z-index: 1; }
.pmlp-btn-primary:hover::before{ transform: translateX(0); }
.pmlp-btn-primary:active{ transform: scale(0.97); box-shadow: 0 0 0 1px rgba(0,0,0,0.5); }
.pmlp-btn-primary:focus-visible{ outline: 2px solid #ffffff; outline-offset: 2px; }

/* Secondary */
.pmlp-btn-secondary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: #1b1b1f;
  color: var(--pml-color-text-soft) !important;
  font-size: var(--pml-font-size-xs);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.pmlp-btn-secondary:active{ transform: scale(0.98); }
.pmlp-btn-secondary:focus-visible{
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.pmlp-btn-secondary:hover,
.pmlp-btn-secondary:focus-visible{
  background: #2D2D2D;
}

/* Copy button (small) */
.pmlp-copy{
  display:flex;
  gap: 8px;
  align-items:center;
}
.pmlp-copy input,
.pmlp-copy textarea{
  flex:1;
}
.pmlp-copy .pmlp-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: none;
  padding: 8px 18px;
  font-size: var(--pml-font-size-xs);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, background 160ms ease;
}

/* =========================================
   TABLES
   ========================================= */
.pmlp-table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: transparent;
}
.pmlp-table th,
.pmlp-table td{
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align:left;
  font-size: 13px;
  color: var(--pml-color-text-soft);
}
.pmlp-table th{
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pmlp-table tr:hover td{
  background: rgba(255,255,255,0.03);
}

/* =========================================
   STATUS MESSAGES
   ========================================= */
.pmlp-error,
.pmlp-success{
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--pml-color-border-subtle);
  margin: 12px 0 0;
  font-size: 13px;
}
.pmlp-error{
  background: rgba(218, 43, 53, 0.10);
  border-color: rgba(218, 43, 53, 0.35);
  color: #fff;
}
.pmlp-success{
  background: rgba(255,255,255,0.06);
  color: var(--pml-color-text-soft);
}

/* Links */
.pmlp-bg a{
  color: var(--pml-color-accent);
  text-decoration:none;
}
.pmlp-bg a:hover{
  color: #ff4a54;
  text-decoration: underline;
}
.pmlp-bg a:focus-visible{
  outline: 2px solid var(--pml-color-accent);
  outline-offset: 2px;
}


/* Ensure brand headings are not overridden by theme */
.pmlp-portal .pmlp-brand h1{font-size:22px !important;line-height:1.2 !important;}
.pmlp-portal .pmlp-brand h2{font-size:18px !important;line-height:1.25 !important;}
.pmlp-portal .pmlp-brand h3{font-size:15px !important;line-height:1.3 !important;}

/* Added for referrals visit listing */

.pmlp-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 14px 0}
@media (max-width: 720px){.pmlp-tiles{grid-template-columns:repeat(2,minmax(0,1fr));}}
.pmlp-sub{font-size:12px;opacity:.8;margin-top:4px;word-break:break-word;}
.pmlp-pagination{display:flex;gap:10px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap;}
