/* ───────────────────────────────────────────────────────────────────────────
   WP Subscription Manager – Frontend Styles
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --wpsm-primary:     #4F46E5;
  --wpsm-primary-dk:  #3730a3;
  --wpsm-success:     #16a34a;
  --wpsm-danger:      #dc2626;
  --wpsm-warn:        #d97706;
  --wpsm-gray-50:     #f9fafb;
  --wpsm-gray-100:    #f3f4f6;
  --wpsm-gray-200:    #e5e7eb;
  --wpsm-gray-500:    #6b7280;
  --wpsm-gray-700:    #374151;
  --wpsm-gray-900:    #111827;
  --wpsm-radius:      12px;
  --wpsm-shadow:      0 4px 24px rgba(0,0,0,.08);
}

.wpsm-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--wpsm-gray-900);
}

/* ── Notices ──────────────────────────────────────────────────────────────── */
.wpsm-notice {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.wpsm-notice-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.wpsm-notice-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.wpsm-notice-warn    { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.wpsm-notice.is-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.wpsm-notice.is-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.wpsm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
  width: 100%;
  margin-top: 8px;
}
.wpsm-btn-primary  { background: var(--wpsm-primary); color: #fff; }
.wpsm-btn-primary:hover { background: var(--wpsm-primary-dk); color: #fff; }
.wpsm-btn-secondary { background: var(--wpsm-gray-100); color: var(--wpsm-gray-700); border: 1px solid var(--wpsm-gray-200); }
.wpsm-btn-danger   { background: var(--wpsm-danger); color: #fff; }
.wpsm-btn-danger:hover { background: #b91c1c; }
.wpsm-btn-ghost    { background: transparent; color: var(--wpsm-gray-500); border: 1px solid var(--wpsm-gray-200); }
.wpsm-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Form Card ────────────────────────────────────────────────────────────── */
.wpsm-form-card {
  max-width: 460px;
  margin: 40px auto;
  background: #fff;
  border-radius: var(--wpsm-radius);
  padding: 40px;
  box-shadow: var(--wpsm-shadow);
  border: 1px solid var(--wpsm-gray-200);
}
.wpsm-form-title    { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.wpsm-form-subtitle { color: var(--wpsm-gray-500); margin: 0 0 28px; font-size: 14px; }
.wpsm-form-footer   { text-align: center; font-size: 14px; color: var(--wpsm-gray-500); margin-top: 16px; }
.wpsm-form-footer a { color: var(--wpsm-primary); text-decoration: none; font-weight: 600; }

/* ── Fields ───────────────────────────────────────────────────────────────── */
.wpsm-field { margin-bottom: 18px; }
.wpsm-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--wpsm-gray-700);
  margin-bottom: 6px;
}
.wpsm-field input, .wpsm-field select, .wpsm-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--wpsm-gray-200);
  border-radius: 8px;
  font-size: 15px;
  color: var(--wpsm-gray-900);
  background: #fff;
  transition: border-color .15s;
  box-sizing: border-box;
}
.wpsm-field input:focus {
  outline: none;
  border-color: var(--wpsm-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.wpsm-field .description { font-size: 12px; color: var(--wpsm-gray-500); margin-top: 4px; }
.wpsm-disabled { background: var(--wpsm-gray-50) !important; color: var(--wpsm-gray-500) !important; }
.wpsm-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wpsm-checkbox-row { display: flex; align-items: center; }
.wpsm-checkbox-row label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.req { color: var(--wpsm-danger); }

/* ── Pricing Grid ────────────────────────────────────────────────────────── */
.wpsm-pricing-header { text-align: center; margin-bottom: 40px; }
.wpsm-pricing-header h2 { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.wpsm-pricing-header p { font-size: 16px; color: var(--wpsm-gray-500); }
.wpsm-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 30px; }

.wpsm-plan-card {
  background: #fff;
  border: 2px solid var(--wpsm-gray-200);
  border-radius: var(--wpsm-radius);
  padding: 32px;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.wpsm-plan-card:hover { transform: translateY(-4px); box-shadow: var(--wpsm-shadow); }
.wpsm-plan-featured { border-color: var(--wpsm-primary); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }

.wpsm-popular-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--wpsm-primary); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 16px; border-radius: 99px;
  white-space: nowrap;
}
.wpsm-plan-name  { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.wpsm-plan-price { font-size: 48px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.wpsm-plan-price .currency { font-size: 24px; vertical-align: top; margin-top: 10px; display: inline-block; }
.wpsm-plan-price .period { font-size: 16px; color: var(--wpsm-gray-500); font-weight: 400; }
.wpsm-saving { font-size: 13px; color: var(--wpsm-success); font-weight: 600; margin-bottom: 12px; }
.wpsm-plan-desc { font-size: 14px; color: var(--wpsm-gray-500); margin-bottom: 20px; }
.wpsm-plan-features { list-style: none; padding: 0; margin: 0 0 24px; }
.wpsm-plan-features li { font-size: 14px; padding: 5px 0; color: var(--wpsm-gray-700); }

/* ── PayPal box ──────────────────────────────────────────────────────────── */
.wpsm-paypal-box {
  background: #fff;
  border: 2px solid var(--wpsm-gray-200);
  border-radius: var(--wpsm-radius);
  padding: 30px;
  text-align: center;
}
.wpsm-paypal-box h3 { margin-top: 0; }
.wpsm-security-note { text-align: center; font-size: 13px; color: var(--wpsm-gray-500); margin-top: 20px; }

/* ── Account Tabs ────────────────────────────────────────────────────────── */
.wpsm-account-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px;
  border-bottom: 2px solid var(--wpsm-gray-200); padding-bottom: 0;
}
.wpsm-tab-btn {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--wpsm-gray-500);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.wpsm-tab-btn:hover { color: var(--wpsm-primary); }
.wpsm-tab-btn.active { color: var(--wpsm-primary); border-bottom-color: var(--wpsm-primary); }
.wpsm-logout-btn { margin-left: auto; color: var(--wpsm-danger) !important; }

.wpsm-tab-content { display: none; }
.wpsm-tab-content.active { display: block; }

/* ── Account Cards ───────────────────────────────────────────────────────── */
.wpsm-account-card {
  background: #fff;
  border: 1px solid var(--wpsm-gray-200);
  border-radius: var(--wpsm-radius);
  padding: 28px;
  margin-bottom: 24px;
}
.wpsm-account-card h4 { margin-top: 0; font-size: 18px; }
.wpsm-sub-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0; }
.wpsm-sub-detail-grid div label { font-size: 12px; color: var(--wpsm-gray-500); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.wpsm-sub-detail-grid div span { font-size: 15px; font-weight: 600; }
.wpsm-no-sub { text-align: center; padding: 40px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.wpsm-badge { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; display: inline-block; }
.wpsm-badge-green  { background: #dcfce7; color: #166534; }
.wpsm-badge-red    { background: #fee2e2; color: #991b1b; }
.wpsm-badge-yellow { background: #fef9c3; color: #92400e; }
.wpsm-badge-gray   { background: var(--wpsm-gray-100); color: var(--wpsm-gray-500); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.wpsm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wpsm-table th { text-align: left; padding: 10px 14px; background: var(--wpsm-gray-50); font-weight: 600; border-bottom: 2px solid var(--wpsm-gray-200); }
.wpsm-table td { padding: 10px 14px; border-bottom: 1px solid var(--wpsm-gray-100); }
.wpsm-table tr:last-child td { border-bottom: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .wpsm-form-card  { padding: 24px 16px; margin: 20px auto; }
  .wpsm-field-row  { grid-template-columns: 1fr; }
  .wpsm-plan-price { font-size: 36px; }
  .wpsm-account-tabs { flex-direction: column; }
  .wpsm-logout-btn { margin-left: 0; }
}
