/* =========================================================================
   Castr Paywall — UI/UX enhancement layer.
   Loaded AFTER app.css so it refines the ported Blade design without breaking
   the iframe-embed contract, per-master logos, or the Stripe payment widget.
   ========================================================================= */

:root {
  --cp-primary: #0062ff;
  --cp-primary-600: #0052d6;
  --cp-primary-700: #0046b8;
  --cp-ink: #0f1b3d;
  --cp-ink-2: #3a4a6b;
  --cp-muted: #8794b5;
  --cp-line: #e4e9f2;
  --cp-bg: #f5f7fb;
  --cp-card: #ffffff;
  --cp-success: #19b36b;
  --cp-danger: #e25858;
  --cp-radius: 16px;
  --cp-radius-sm: 10px;
  --cp-shadow: 0 10px 30px rgba(15, 27, 61, 0.08);
  --cp-shadow-lg: 0 24px 60px rgba(15, 27, 61, 0.16);
  --cp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--cp-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--cp-ink);
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  font-family: var(--cp-font);
  font-weight: 600;
  border-radius: var(--cp-radius-sm);
  padding: 12px 20px;
  transition: transform .06s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid rgba(0, 98, 255, .35); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }

.btn-primary,
.card-body button,
.btn.btn-primary {
  background: var(--cp-primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(0, 98, 255, .25);
}
.btn-primary:hover,
.card-body button:hover { background: var(--cp-primary-600) !important; }
.btn-primary:disabled, .btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-link { font-weight: 600; color: var(--cp-primary); }

/* ---- Inputs ----------------------------------------------------------- */
.form-control {
  border: 1.5px solid var(--cp-line);
  border-radius: var(--cp-radius-sm);
  padding: 12px 14px;
  height: auto;
  font-size: 15px;
  color: var(--cp-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  box-shadow: none;
}
.form-control:focus {
  border-color: var(--cp-primary);
  box-shadow: 0 0 0 4px rgba(0, 98, 255, .12);
}
.form-control.is-invalid { border-color: var(--cp-danger); }
label.text-base, .form-group label { font-weight: 600; color: var(--cp-ink-2); margin-bottom: 6px; }
.invalid-feedback strong { font-weight: 600; }

/* ---- Top nav / brand bar --------------------------------------------- */
.navbar.navigation {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(140%) blur(8px);
  box-shadow: 0 1px 0 rgba(15, 27, 61, .06);
  padding: .6rem 1.25rem;
}
.navbar.navigation .navbar-brand img { object-fit: contain; max-height: 48px; width: auto; }
.btn-login {
  border-radius: 999px !important;
  padding: 8px 22px !important;
}

/* ---- Alerts ----------------------------------------------------------- */
.alert {
  border: none;
  border-radius: var(--cp-radius-sm);
  font-weight: 500;
  padding: 12px 16px;
}
.alert-success { background: #e7f8ef; color: #0e7a4a; }
.alert-danger { background: #fdeaea; color: #b42525; }

/* =========================================================================
   GUEST PAYWALL  (/{master}/stream/{stream} — the conversion screen)
   Cosmetic-only: keep app.css's overlay layout/positioning untouched.
   ========================================================================= */

/* the floating checkout card */
.card-subscribe {
  border-radius: var(--cp-radius) !important;
  box-shadow: var(--cp-shadow-lg) !important;
}
.card-subscribe .text-medium {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cp-muted) !important;
}
.card-subscribe .text-title,
.card-subscribe .text-base {
  color: var(--cp-ink) !important;
  font-weight: 800 !important;
}
.card-subscribe .cp-secure {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--cp-muted);
  margin: 10px 0 0;
}
.card-subscribe .cp-haveaccess {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-primary);
  margin-top: 6px;
  text-decoration: none;
}
.card-subscribe .cp-haveaccess:hover { text-decoration: underline; }

/* event title + host block */
.stream-guest__card--title.text-title { color: var(--cp-ink); }
.stream-guest__card--title a { color: var(--cp-primary); }
.stream-guest__undertext { color: var(--cp-muted); }

/* =========================================================================
   AUTH SCREEN  (full overhaul — new markup in login.hbs, .cp-auth namespace)
   ========================================================================= */
.cp-auth {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 56px;
  background: linear-gradient(160deg, #f3f6fd 0%, #e9eefb 100%);
}
.cp-auth-card {
  width: 100%;
  max-width: 432px;
  background: #fff;
  border: 1px solid var(--cp-line);
  border-radius: 20px;
  box-shadow: var(--cp-shadow-lg);
  padding: 32px 30px;
}
.cp-auth-head { text-align: center; margin-bottom: 22px; }
.cp-auth-title { font-size: 24px; font-weight: 800; color: var(--cp-ink); margin: 0 0 6px; }
.cp-auth-sub { color: var(--cp-muted); font-size: 14px; line-height: 1.5; margin: 0; }
.cp-auth-sub strong { color: var(--cp-ink); }

.cp-auth-tabs {
  display: flex;
  background: #eef1f7;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}
.cp-auth-tab {
  flex: 1; border: none; background: transparent;
  padding: 10px; border-radius: 9px;
  font-weight: 700; font-size: 14px; color: var(--cp-ink-2);
  cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s;
}
.cp-auth-tab.active { background: #fff; color: var(--cp-primary); box-shadow: 0 2px 8px rgba(15, 27, 61, .08); }

.cp-auth-panel { display: none; flex-direction: column; gap: 16px; }
.cp-auth-panel.active { display: flex; animation: cpfade .25s ease; }
@keyframes cpfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cp-field { display: flex; flex-direction: column; gap: 7px; }
.cp-field label { font-weight: 600; font-size: 13.5px; color: var(--cp-ink-2); }
.cp-input {
  border: 1.5px solid var(--cp-line); border-radius: 11px;
  padding: 12px 14px; font-size: 15px; width: 100%; color: var(--cp-ink);
  transition: border-color .15s, box-shadow .15s; background: #fff;
}
.cp-input::placeholder { color: #b7c0d6; }
.cp-input:focus { outline: none; border-color: var(--cp-primary); box-shadow: 0 0 0 4px rgba(0, 98, 255, .12); }
.cp-input.is-invalid { border-color: var(--cp-danger); }

.cp-input-wrap { position: relative; }
.cp-input-wrap .cp-input { padding-right: 64px; }
.cp-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--cp-muted);
  font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 8px;
}
.cp-eye:hover { color: var(--cp-primary); }

.cp-err { color: var(--cp-danger); font-size: 13px; font-weight: 500; }
.cp-alert { background: #fdeaea; color: #b42525; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; font-weight: 500; }

.cp-auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.cp-check { display: flex; align-items: center; gap: 7px; color: var(--cp-ink-2); margin: 0; cursor: pointer; }
.cp-link { color: var(--cp-primary); font-weight: 600; text-decoration: none; }
.cp-link:hover { text-decoration: underline; }
.cp-submit { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px !important; margin-top: 4px; }
.cp-auth-foot { text-align: center; color: var(--cp-muted); font-size: 12.5px; margin: 20px 0 0; }

@media (max-width: 480px) { .cp-auth-card { padding: 26px 20px; } }

/* =========================================================================
   STREAM (locked) — hosts the unified in-page paywall overlay widget
   ========================================================================= */
.cp-embed-page {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 56px;
}
.cp-embed-inner { width: 100%; max-width: 900px; }

/* =========================================================================
   PAY PAGE  (keep <stripe> widget; refine the surrounding card)
   ========================================================================= */
.container .card {
  border: 1px solid var(--cp-line);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
}
.page-title { font-weight: 800; color: var(--cp-ink); }
.card-body.fs-exclude, .card-body { border-radius: var(--cp-radius); }
.cp-order-summary { color: var(--cp-ink-2); font-size: 15px; margin-bottom: 22px; }
.cp-order-summary strong { color: var(--cp-ink); }

/* =========================================================================
   THANKS  (success state)
   ========================================================================= */
.payment-success-wrapper { text-align: center; padding: 16px; }
.payment-success-wrapper .card-header {
  border: none; background: transparent; font-size: 22px; font-weight: 800; color: var(--cp-success);
}
.payment-success-wrapper .card-header::before {
  content: "✓"; display: block; width: 64px; height: 64px; line-height: 64px; margin: 8px auto 12px;
  border-radius: 50%; background: #e7f8ef; color: var(--cp-success); font-size: 32px; font-weight: 700;
}

/* =========================================================================
   PROFILE  (subscription list)
   ========================================================================= */
.profile { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.profile__card, .profile__subscription { background: var(--cp-card); border: 1px solid var(--cp-line); border-radius: var(--cp-radius); box-shadow: var(--cp-shadow); padding: 22px 24px; margin-bottom: 20px; }
.subscription__item { border: 1px solid var(--cp-line); border-radius: var(--cp-radius-sm); padding: 16px !important; margin-bottom: 12px; }
.badge { border-radius: 999px; padding: .4em .8em; font-weight: 600; }

/* =========================================================================
   Friendly states (stripe-not-active / link-expired)
   ========================================================================= */
.expiry-wrapper { min-height: 240px; }
.expiry-area-content h2 { font-weight: 800; color: var(--cp-ink); }
.expiry-area-content p { color: var(--cp-muted); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 600px) {
  .card-subscribe { margin-top: -40px; padding: 22px 18px; }
  .card-subscribe .text-title, .card-subscribe .text-base { font-size: 28px; }
  .login__card { max-width: 100%; }
  .stream-guest { padding: 16px 12px 48px; }
}
