/**
 * TW Email Preferences (Simple) — styles
 * File: assets/twep.css
 * Version sync: 1.0.7
 */

/* =========================================================
   TWEP: FRONT UI (ParitShop)
========================================================= */

.twep-wrap,
.twep-wrap *{
  box-sizing: border-box;
}

.twep-wrap{
  /* ParitShop fallbacks */
  --twep-accent: var(--e-global-color-primary, #4b007b); /* purple */
  --twep-accent-2: var(--ps-magenta, #ad04c7);          /* magenta */
  --twep-ok: var(--ps-green, #2f5f00);                  /* green */
  --twep-text: rgba(0,0,0,.86);
  --twep-muted: rgba(0,0,0,.62);
  --twep-border: rgba(0,0,0,.10);
  --twep-shadow: 0 10px 28px rgba(0,0,0,.10);
  --twep-field-shadow: 0 6px 16px rgba(0,0,0,.08);

  display:flex;
  justify-content:center;
  padding: 28px 12px;
}

.twep-card{
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--twep-border);
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: var(--twep-shadow);
  position: relative;
  overflow: hidden;
}

.twep-card::before{
  content:"";
  position:absolute;
  left:0; top:0;
  width:100%;
  height: 5px;
  background: linear-gradient(90deg, var(--twep-accent), var(--twep-accent-2));
}

.twep-title{
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--twep-text);
}

.twep-subtitle{
  margin: 0 0 16px;
  color: var(--twep-muted);
  font-size: 14px;
  font-weight: 600;
}

.twep-alert{
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,.10);
}
.twep-alert--ok{
  background: rgba(47, 95, 0, .10);
  border-color: rgba(47, 95, 0, .25);
  color: rgba(0,0,0,.78);
}
.twep-alert--info{
  background: rgba(75, 0, 123, .08);
  border-color: rgba(75, 0, 123, .22);
  color: rgba(0,0,0,.78);
}
.twep-alert--warn{
  background: rgba(241, 196, 15, .14);
  border-color: rgba(241, 196, 15, .34);
  color: rgba(0,0,0,.78);
}

.twep-form .twep-field{ margin-bottom: 14px; }

.twep-form label{
  display:block;
  font-weight: 800;
  margin-bottom: 7px;
  color: var(--twep-text);
}

.twep-label{
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--twep-text);
}

.twep-form input[type="email"],
.twep-form input[type="text"],
.twep-form select{
  width:100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  padding: 0 12px;
  outline: none;
  background: #fff;
  box-shadow: var(--twep-field-shadow);
  transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
  color: var(--twep-text);
  font-weight: 750;
}

.twep-form input::placeholder{
  color: rgba(0,0,0,.40);
  font-weight: 650;
}

.twep-form select{
  padding-right: 10px;
  cursor: pointer;
}

.twep-form input[type="email"]:focus,
.twep-form input[type="text"]:focus,
.twep-form select:focus{
  border-color: rgba(75, 0, 123, .55);
  box-shadow: 0 0 0 4px rgba(75, 0, 123, .14), var(--twep-field-shadow);
}

.twep-help{
  margin: 7px 0 0;
  font-size: 12px;
  color: rgba(0,0,0,.58);
  font-weight: 600;
}

.twep-help--tiny{
  margin-top: 12px;
  font-size: 11.5px;
  opacity: .85;
}

.twep-checklist{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

/* checkbox modern */
.twep-check input[type="checkbox"]{
  accent-color: var(--twep-accent);
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.twep-check{
  display:flex !important;
  align-items:flex-start;
  gap: 10px;
  font-weight: 750;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(75, 0, 123, .045);
  transition: transform .08s ease, border-color .15s ease, background-color .15s ease;
}

.twep-check:hover{
  border-color: rgba(75, 0, 123, .25);
  background: rgba(75, 0, 123, .06);
}

.twep-check:active{
  transform: translateY(1px);
}

.twep-check span{
  color: var(--twep-text);
  line-height: 1.25;
}

.twep-check--strong{
  background: rgba(47, 95, 0, .06);
  border-color: rgba(47, 95, 0, .16);
}

.twep-check--strong span{
  font-weight: 900;
}

.twep-actions{
  margin-top: 16px;
}

/* ✅ buttons: solid Parit magenta */
.twep-btn{
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .6px;
  background: #a80186;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.12);
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease;
}

.twep-btn:hover{
  filter: brightness(.98);
  box-shadow: 0 12px 24px rgba(0,0,0,.14);
}

.twep-btn:active{
  transform: translateY(1px);
}

/* honeypot скрит */
.twep-hp{
  position:absolute !important;
  left:-9999px !important;
  top:auto !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
}

/* =========================================================
   TWEP: FRONT POPUP (success modal)
========================================================= */

.twep-modal{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
}

.twep-modal.twep-modal--show{
  display: block;
}

.twep-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(2px);
}

.twep-modal__panel{
  position: relative;
  width: calc(100% - 28px);
  max-width: 520px;
  margin: 12vh auto 0;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  padding: 18px 16px 16px;
  transform: translateY(8px) scale(.98);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  overflow: hidden;
}

.twep-modal.twep-modal--show .twep-modal__panel{
  transform: translateY(0) scale(1);
  opacity: 1;
}

.twep-modal__panel::before{
  content:"";
  position:absolute;
  left:0; top:0;
  width:100%;
  height: 5px;
  background: linear-gradient(90deg, var(--twep-accent), var(--twep-accent-2));
}

.twep-modal__title{
  margin: 8px 0 6px;
  font-size: 18px;
  font-weight: 900;
  color: var(--twep-text);
}

.twep-modal__text{
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 750;
  color: rgba(0,0,0,.70);
  line-height: 1.35;
}

/* ✅ modal button: solid Parit magenta */
.twep-modal__btn{
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .3px;
  background: #a80186;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.12);
}

.twep-modal__btn:hover{ filter: brightness(.98); }

/* =========================================================
   TWEP: ADMIN UI (WP_List_Table FIX)
========================================================= */

.twep-admin{
  box-sizing: border-box;
}
.twep-admin *,
.twep-admin *::before,
.twep-admin *::after{
  box-sizing: inherit;
}

.twep-admin .twep-admin-actions{ margin: 10px 0 14px; }

.twep-admin .tablenav{
  height: auto !important;
  overflow: visible !important;
}
.twep-admin .tablenav .actions{
  height: auto !important;
  overflow: visible !important;
}
.twep-admin .tablenav .tablenav-pages{
  height: auto !important;
}

.twep-admin table.wp-list-table{
  display: table !important;
  width: 100% !important;
  clear: both;
}
.twep-admin table.wp-list-table thead{ display: table-header-group !important; }
.twep-admin table.wp-list-table tbody{ display: table-row-group !important; }
.twep-admin table.wp-list-table tfoot{ display: table-footer-group !important; }
.twep-admin table.wp-list-table tr{ display: table-row !important; }
.twep-admin table.wp-list-table th,
.twep-admin table.wp-list-table td{ display: table-cell !important; }

.twep-admin .tablenav .alignleft.actions.twep-admin-filters{
  float: none !important;
  width: 100% !important;
  margin: 10px 0 12px !important;
  padding: 0 !important;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.twep-admin .twep-admin-filters > .twep-af{
  min-width: 220px;
}

.twep-admin .twep-admin-filters label.twep-af{
  display:flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: rgba(0,0,0,.65);
}

.twep-admin .twep-admin-filters label.twep-af > span{
  display:block;
  line-height: 1.2;
  font-weight: 600;
  color: #1d2327;
}

.twep-admin .twep-admin-filters input[type="date"],
.twep-admin .twep-admin-filters input[type="number"],
.twep-admin .twep-admin-filters select{
  width: 100% !important;
  max-width: 100% !important;
  min-height: 34px;
  margin: 0 !important;
}

.twep-admin .twep-admin-filters .twep-af--perpage{
  min-width: 140px;
}
.twep-admin .twep-admin-filters .twep-af--perpage input{
  text-align: center;
}

.twep-admin .twep-admin-filters .button,
.twep-admin .twep-admin-filters input[type="submit"].button{
  width: auto !important;
  min-width: unset !important;
  height: 34px;
  margin: 0 !important;
  justify-self: start;
}

.twep-purge-form{
  clear: both;
  margin-top: 12px;
}

.twep-badge{
  display:inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.08);
  font-size: 12px;
  margin: 2px 4px 2px 0;
  line-height: 1.2;
  vertical-align: middle;
}

.twep-badge--ok{
  background: rgba(46, 204, 113, .14);
  border-color: rgba(46, 204, 113, .28);
}
.twep-badge--warn{
  background: rgba(241, 196, 15, .16);
  border-color: rgba(241, 196, 15, .32);
}
.twep-badge--danger{
  background: rgba(231, 76, 60, .14);
  border-color: rgba(231, 76, 60, .28);
}
.twep-badge--info{
  background: rgba(52, 152, 219, .14);
  border-color: rgba(52, 152, 219, .28);
}

.twep-muted{ color: rgba(0,0,0,.45); }
.twep-mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

@media (max-width: 782px){
  .twep-admin .tablenav .alignleft.actions.twep-admin-filters{
    grid-template-columns: 1fr;
  }
  .twep-admin .twep-admin-filters > .twep-af{
    min-width: 100%;
  }
  .twep-modal__panel{
    margin-top: 10vh;
  }
}
