/* =====================================================
   Portal-specific styles (complements css/style.css)
   ===================================================== */

/* Portal badge in nav next to logo */
.portal-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  background: var(--color-gold);
  color: #1A1A1A;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 100px;
  vertical-align: 4px;
}

.portal-badge--gold {
  background: var(--color-gold);
  color: #1A1A1A;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 100px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* When the subscription card is selected, flip the badge to black on gold */
.wizard-card input[type="radio"]:checked + .wizard-card__inner .portal-badge--gold {
  background: #1A1A1A;
  color: #ffffff;
}

/* Simplified footer for portal pages */
.portal-footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
  text-align: center;
}

.portal-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.portal-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* Subscription card head: title + price on one line */
.portal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
  flex-wrap: wrap;
}

.portal-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.portal-price__main {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: inherit;
}

.portal-price__small {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.wizard-card input[type="radio"]:checked + .wizard-card__inner .portal-price__small {
  color: #1A1A1A;
  opacity: 0.75;
}

/* Quantity row — image | item info | qty input */
.portal-qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  padding: 8px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  background: var(--bg-secondary);
}

.portal-qty-image {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  background: #ffffff;
  flex-shrink: 0;
  display: block;
}

[data-theme="dark"] .portal-qty-image {
  background: #F7F6F3;
}

.portal-qty-info {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
}

.portal-qty-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.portal-qty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 6px;
  line-height: 1.4;
}

.portal-qty-price {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
}

.portal-qty-price span {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.82rem;
}

.portal-qty-input {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.portal-qty-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.portal-qty-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.portal-qty-btn:last-child {
  border-radius: 0 8px 8px 0;
}

.portal-qty-btn:hover {
  background: var(--color-gold);
  color: #1A1A1A;
  border-color: var(--color-gold);
}

.portal-qty-field {
  width: 56px;
  height: 36px;
  border: 1.5px solid var(--border-color);
  border-left: none;
  border-right: none;
  background: var(--bg-primary);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  -moz-appearance: textfield;
  appearance: textfield;
}

.portal-qty-field::-webkit-inner-spin-button,
.portal-qty-field::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.portal-qty-field:focus {
  outline: none;
  border-color: var(--color-gold);
}

@media (max-width: 600px) {
  .portal-qty-row {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md);
  }

  .portal-qty-image {
    width: 100%;
    height: 180px;
    margin-bottom: 4px;
  }

  .portal-qty-input {
    justify-content: center;
  }
}

/* Summary table on step 5 */
.portal-summary {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.portal-summary__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  font-size: 0.95rem;
}

.portal-summary__row:last-of-type {
  border-bottom: none;
}

.portal-summary__label {
  color: var(--text-primary);
  font-weight: 500;
}

.portal-summary__label small {
  display: block;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 2px;
}

.portal-summary__qty,
.portal-summary__unit,
.portal-summary__total {
  text-align: right;
  white-space: nowrap;
  color: var(--text-primary);
}

.portal-summary__total {
  font-weight: 700;
  min-width: 90px;
}

.portal-summary__divider {
  height: 2px;
  background: var(--text-primary);
  margin: 0;
}

.portal-summary__totals {
  padding: var(--space-lg);
}

.portal-summary__totals-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.portal-summary__totals-row--main {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1.5px solid var(--text-primary);
  padding-top: 10px;
  margin-top: 6px;
}

@media (max-width: 600px) {
  .portal-summary__row {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
  }
  .portal-summary__qty,
  .portal-summary__unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
  }
  .portal-summary__unit { display: none; }
}

/* Terms checkbox */
.portal-terms-box {
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  background: var(--bg-secondary);
}

.portal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.portal-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.portal-checkbox__mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-top: 1px;
}

.portal-checkbox input[type="checkbox"]:checked + .portal-checkbox__mark {
  background: var(--color-gold);
  border-color: var(--color-gold);
}

.portal-checkbox input[type="checkbox"]:checked + .portal-checkbox__mark::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #1A1A1A;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

.portal-checkbox__label {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.portal-checkbox__label a {
  color: var(--text-primary);
  text-decoration: underline;
  font-weight: 600;
}

.portal-terms-box--error {
  border-color: #D64545;
  background: #FDECEC;
}

.portal-terms-error {
  margin: 12px 0 0;
  color: #D64545;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* "What to expect" card — shown under the submit button on step 5 */
.portal-expect-card {
  margin-top: var(--space-2xl);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: var(--space-xl);
  border-left: 4px solid var(--color-gold);
}

.portal-expect-card__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0 0 var(--space-md);
  color: var(--text-primary);
}

.portal-expect-card__list {
  margin: 0;
  padding-left: 24px;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 0.95rem;
  list-style: decimal outside;
}

.portal-expect-card__list li {
  padding-left: 4px;
  margin-bottom: 6px;
}

.portal-expect-card__list li:last-child {
  margin-bottom: 0;
}

.portal-expect-card__list li::marker {
  font-weight: 700;
  color: var(--color-gold);
}

/* Wizard nav */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}

/* Success page card */
.portal-success-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.portal-success-card__label {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portal-success-card__number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin: 0;
}

.portal-next-steps {
  text-align: left;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: var(--space-lg) var(--space-xl);
}

.portal-next-steps h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0 0 var(--space-sm);
  color: var(--text-primary);
}

.portal-next-steps ol {
  margin: 0;
  padding-left: 24px;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 0.95rem;
  list-style: decimal outside;
}

.portal-next-steps ol li {
  padding-left: 4px;
  margin-bottom: 6px;
}

.portal-next-steps ol li::marker {
  font-weight: 700;
  color: var(--color-gold);
}

/* Legal document styling */
.portal-legal h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: var(--space-2xl) 0 var(--space-sm);
  color: var(--text-primary);
}

.portal-legal h2:first-of-type {
  margin-top: 0;
}

.portal-legal p {
  color: var(--text-primary);
  line-height: 1.7;
  margin: 0 0 var(--space-sm);
  font-size: 0.98rem;
}

.portal-legal a {
  color: var(--text-primary);
  text-decoration: underline;
}
