/* Manage subscription — sign-in + post-login states */

.manage-sub-page {
  background: #faf6f0;
  color: var(--night, #1c0a00);
}

.manage-sub-page .checkout-wrap,
.manage-sub-page .manage-page-content {
  max-width: 540px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  min-height: calc(100vh - 80px);
}

.manage-card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(28, 10, 0, 0.06);
  border: 1px solid #e8ddd0;
}

.manage-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e8ddd0;
}

.manage-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.manage-brand-name {
  font-family: var(--font-sans, 'Nunito', sans-serif);
  font-size: 15px;
  font-weight: 800;
  color: var(--saffron, #e8722a);
  line-height: 1.2;
}

.manage-card h1 {
  font-family: var(--font-display, 'Rozha One', serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--night, #2a1508);
  margin: 0 0 12px;
}

.manage-description {
  font-size: 15px;
  line-height: 1.6;
  color: #6b5c52;
  margin: 0 0 28px;
}

.manage-signedin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #f5f0eb;
  border-radius: 10px;
  margin-bottom: 28px;
}

.manage-signedin-bar .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8b7355;
  margin: 0 0 2px;
}

.manage-signedin-bar .number {
  font-size: 15px;
  font-weight: 800;
  color: var(--night, #1c0a00);
  margin: 0;
}

.manage-signout {
  font-size: 13px;
  color: var(--saffron, #e8722a);
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
  flex-shrink: 0;
}

.manage-signout:hover {
  text-decoration: underline;
}

.manage-state-panel[hidden] {
  display: none !important;
}

.manage-no-sub-message {
  text-align: center;
  padding: 8px 0 28px;
}

.manage-no-sub-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
}

.manage-no-sub-message h2 {
  font-family: var(--font-display, 'Rozha One', serif);
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--night, #2a1508);
}

.manage-no-sub-message p {
  font-size: 15px;
  color: #6b5c52;
  margin: 0;
  line-height: 1.55;
}

.manage-plan-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.manage-plan-card {
  flex: 1;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  background: #fff;
  font-family: inherit;
  color: inherit;
}

.manage-plan-card:hover:not(.is-selected) {
  border-color: rgba(232, 114, 42, 0.45);
  transform: translateY(-2px);
}

/* Selected plan only — popular badge does not imply selection */
.manage-plan-card.is-selected {
  border-color: var(--saffron, #e8722a);
  border-width: 3px;
  background: linear-gradient(180deg, rgba(255, 248, 240, 0.95) 0%, #fff 100%);
  box-shadow:
    0 0 0 1px rgba(232, 114, 42, 0.25),
    0 8px 28px rgba(232, 114, 42, 0.18);
  transform: translateY(-2px);
}

.manage-plan-card.is-selected::after {
  content: 'Selected';
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #fff;
  background: var(--saffron, #e8722a);
  border-radius: 100px;
  line-height: 1.2;
}

.manage-plan-card:focus-visible {
  outline: 2px solid var(--saffron, #e8722a);
  outline-offset: 2px;
}

.manage-plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  background: var(--saffron, #e8722a);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 100px;
  white-space: nowrap;
}

.manage-plan-name {
  font-family: var(--font-display, 'Rozha One', serif);
  font-size: 20px;
  color: var(--night, #2a1508);
  margin-bottom: 4px;
}

.manage-plan-price {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 800;
  color: var(--saffron, #e8722a);
  line-height: 1.15;
}

.manage-plan-price span {
  font-size: 14px;
  font-weight: 600;
  color: #6b5c52;
}

.manage-plan-detail {
  font-size: 12px;
  color: #6b5c52;
  margin-top: 4px;
}

.manage-btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--saffron, #e8722a), #f59e4b);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232, 114, 42, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.manage-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232, 114, 42, 0.4);
}

.manage-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.manage-section-title {
  font-family: var(--font-display, 'Rozha One', serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--night, #1c0a00);
  margin: 0 0 6px;
}

.manage-section-desc {
  font-size: 13px;
  color: #8b7355;
  margin: 0 0 20px;
  line-height: 1.5;
}

.manage-sub-card {
  border: 1.5px solid #c6e7c6;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.manage-sub-card.is-cancel-scheduled {
  border-color: #f59e0b;
  background: #fff;
}

.manage-active-badge {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.manage-active-badge.is-warning {
  background: #f59e0b;
}

.manage-active-badge.is-trial {
  background: #0f6e56;
}

.manage-sub-card.is-coupon-trial {
  border-color: #a8dcc4;
  background: linear-gradient(180deg, #f8fdfb 0%, #fff 100%);
}

.manage-trial-note {
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--night);
  background: #eef9f3;
  border: 1px solid #c8e6d4;
  border-radius: 10px;
}

.manage-trial-note strong {
  color: #0f6e56;
}

.manage-trial-note--warn {
  background: #fff8e6;
  border-color: #f0d9a8;
  color: #5c4a1e;
}

.manage-trial-note--warn strong {
  color: #8a5a00;
}

.manage-cancel-msg {
  text-align: center;
  font-size: 14px;
  color: #8b7355;
  margin: 0 0 20px;
  line-height: 1.6;
}

.manage-btn-resub {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--saffron, #e8722a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.2s;
  margin-bottom: 16px;
}

.manage-btn-resub:hover {
  background: var(--saffron-hover, #d4641e);
}

/* Cancel subscription modal */
.manage-cancel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 10, 0, 0.5);
  backdrop-filter: blur(4px);
}

.manage-cancel-overlay[hidden] {
  display: none !important;
}

body.manage-cancel-modal-open .manage-page-content {
  filter: blur(2px);
  opacity: 0.4;
  pointer-events: none;
}

.manage-cancel-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(28, 10, 0, 0.3);
  animation: manageCancelModalIn 0.25s ease-out;
}

@keyframes manageCancelModalIn {
  from {
    transform: scale(0.95) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.manage-cancel-modal__header {
  background: var(--cream, #fdf3e3);
  padding: 28px 28px 20px;
  text-align: center;
}

.manage-cancel-modal__icon {
  font-size: 36px;
  margin-bottom: 8px;
  line-height: 1;
}

.manage-cancel-modal__title {
  font-family: var(--font-display, 'Rozha One', serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--night, #1c0a00);
  margin: 0 0 4px;
}

.manage-cancel-modal__body {
  padding: 24px 28px;
}

.manage-cancel-modal__text {
  font-size: 15px;
  color: #555;
  line-height: 1.65;
  text-align: center;
  margin: 0 0 8px;
}

.manage-cancel-modal__highlight {
  font-size: 13px;
  color: #8b7355;
  text-align: center;
  margin: 0 0 24px;
  padding: 10px 16px;
  background: var(--cream, #fdf3e3);
  border-radius: 8px;
}

.manage-cancel-modal__highlight strong {
  color: var(--night, #1c0a00);
}

.manage-cancel-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manage-cancel-modal__keep {
  width: 100%;
  padding: 15px;
  background: var(--saffron, #e8722a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.manage-cancel-modal__keep:hover:not(:disabled) {
  background: var(--saffron-hover, #d4641e);
}

.manage-cancel-modal__confirm {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  color: #999;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.manage-cancel-modal__confirm:hover:not(:disabled) {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}

.manage-cancel-modal__keep:disabled,
.manage-cancel-modal__confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.manage-cancel-modal-open {
  overflow: hidden;
}

.manage-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0ede8;
  font-size: 14px;
}

.manage-sub-row:last-child {
  border-bottom: none;
}

.manage-sub-row .label {
  color: #8b7355;
}

.manage-sub-row .value {
  font-weight: 700;
  color: var(--night, #1c0a00);
  text-align: right;
}

.manage-upgrade-nudge {
  background: var(--cream, #fdf3e3);
  border-radius: 10px;
  padding: 14px 20px;
  text-align: center;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--night, #1c0a00);
  line-height: 1.5;
}

.manage-upgrade-nudge a {
  color: var(--saffron, #e8722a);
  font-weight: 800;
  text-decoration: none;
}

.manage-upgrade-nudge a:hover {
  text-decoration: underline;
}

.manage-btn-cancel {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: #dc2626;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid #e8ddd0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.manage-btn-cancel:hover:not(:disabled) {
  background: #fef2f2;
}

.manage-btn-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.manage-flash {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.manage-flash--success {
  background: #e8f5e9;
  border: 1px solid rgba(46, 125, 50, 0.25);
  color: #1b5e20;
}

.manage-expired-plan {
  padding: 24px;
  background: #ffebee;
  border: 1px solid rgba(198, 40, 40, 0.15);
  border-radius: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.manage-expired-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.manage-expired-plan p {
  font-size: 15px;
  color: #6b5c52;
  margin: 0;
  line-height: 1.55;
}

.manage-expired-plan strong {
  color: var(--night, #2a1508);
}

.manage-help-text {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  color: #6b5c52;
  line-height: 1.5;
}

.manage-help-text a {
  color: var(--saffron, #e8722a);
  text-decoration: none;
  font-weight: 700;
}

.manage-help-text a:hover {
  text-decoration: underline;
}

.manage-loading-inline,
.manage-note-inline {
  font-size: 14px;
  color: #6b5c52;
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.5;
}

.checkout-error-banner {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.checkout-error-banner a {
  color: inherit;
  font-weight: 600;
}

/* Auth form inside manage card */
.manage-auth-wrap .subscribe-auth-card {
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.manage-auth-wrap .subscribe-auth__title,
.manage-auth-wrap .subscribe-auth__hint {
  display: none;
}

.manage-auth-wrap .subscribe-auth__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b5c52;
}

.manage-auth-wrap .subscribe-auth__phone-row {
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.manage-auth-wrap .subscribe-auth__select,
.manage-auth-wrap .subscribe-auth__input {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
}

.manage-auth-wrap .subscribe-auth__select.subscribe-auth__dial {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.manage-auth-wrap .subscribe-auth__btn-otp.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(232, 114, 42, 0.3);
}

.manage-auth-wrap .subscribe-auth__btn-resend {
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--muted, #a89080);
  font-weight: 600;
  box-shadow: none;
}

.manage-auth-wrap .subscribe-auth__btn-resend:hover:not(:disabled) {
  color: var(--saffron, #e8722a);
  background: none;
}

.manage-auth-wrap .subscribe-auth__divider {
  margin: 28px 0;
}

.manage-auth-wrap .subscribe-auth__status {
  margin-bottom: 12px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .manage-sub-page .manage-page-content {
    padding: 20px 14px 60px;
  }

  .manage-card {
    padding: 24px 18px;
  }

  .manage-card h1 {
    font-size: 26px;
  }

  .manage-plan-cards {
    flex-direction: column;
  }

  .manage-auth-wrap .subscribe-auth__phone-row {
    grid-template-columns: minmax(6.25rem, 34%) 1fr;
    gap: 8px;
  }

  .manage-auth-wrap .subscribe-auth__select,
  .manage-auth-wrap .subscribe-auth__input {
    font-size: 16px;
    padding: 12px 14px;
    min-height: 48px;
  }

  .manage-auth-wrap .subscribe-auth__btn-otp.btn-primary {
    min-height: 50px;
  }

  .manage-signedin-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .manage-cancel-modal__header {
    padding: 24px 20px 16px;
  }

  .manage-cancel-modal__body {
    padding: 20px;
  }
}
