/* ============================================================================
 * Umivo Subscriptions (`subscriptions/styles.css`)
 * Built strictly on `../ux-ui/umivo-ui.css` semantic tokens & primitives.
 * ============================================================================ */

.sub-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
}

/* Sticky Top Navigation (exact 3-column centering) */
.sub-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sub-nav-inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.sub-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sub-brand:hover {
  text-decoration: none;
}

.sub-brand-logo {
  width: 24px;
  height: 24px;
  display: block;
  color: var(--foreground);
  flex-shrink: 0;
}

.sub-nav-links {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sub-nav-links .um-btn {
  padding: 0 12px;
  font-size: 13px;
}

.sub-nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main Content Container */
.sub-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero Section */
.sub-hero {
  padding: 52px 0 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sub-hero-title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

.sub-hero-lead {
  margin: 0;
  max-width: 600px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* Primary Audience Switcher (`Для себя` / `Корпоративная`) */
.sub-audience-bar {
  margin-top: 8px;
}

.sub-audience-toggle {
  padding: 3px;
}

.sub-audience-toggle > button {
  min-height: 34px;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 500;
}

/* Plan Panels */
.sub-panel {
  padding-bottom: 64px;
}

.sub-panel[hidden] {
  display: none;
}

/* Personal 4-Card Pricing Grid with Subgrid Horizontal Row Alignment */
.sub-plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 0;
  align-items: stretch;
}

.sub-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 24px;
  border-radius: var(--radius-2xl);
  background-color: var(--card);
  border: 1px solid var(--card-border);
  transition:
    border-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

@media (min-width: 1121px) {
  @supports (grid-template-rows: subgrid) {
    .sub-plans-grid {
      grid-template-rows: auto auto auto auto 1fr;
    }

    .sub-plans-grid > .sub-plan-card {
      display: grid;
      grid-row: span 5;
      grid-template-rows: subgrid;
      row-gap: 0;
    }
  }
}

.sub-plan-card:hover {
  border-color: var(--border-strong);
}

.sub-plan-card.is-featured {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--card-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent), var(--shadow-sm);
}

.sub-plan-card.is-ultra {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 5.5%, var(--card)) 0%,
    var(--card) 42%
  );
  border-color: color-mix(in srgb, var(--border-strong) 90%, transparent);
}

.sub-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 10px;
}

.sub-plan-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.sub-plan-desc {
  margin: 0;
  min-height: 58px;
  font-size: 13px;
  line-height: 1.48;
  color: var(--muted-foreground);
}

/* Price Block */
.sub-price-block {
  margin: 18px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 58px;
  align-self: start;
}

.sub-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.sub-price-amount {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

.sub-price-amount.is-custom {
  font-size: 26px;
  line-height: 1.25;
}

.sub-price-period {
  font-size: 13px;
  color: var(--muted-foreground);
}

.sub-price-note {
  font-size: 11.5px;
  color: var(--muted-foreground);
  line-height: 1.38;
}

/* Ultra x5 / x20 Inline Tier Selector */
.sub-ultra-switcher {
  display: inline-flex;
  padding: 2px;
}

.sub-ultra-switcher > button {
  min-height: 22px;
  min-width: 34px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* CTA Button inside Plan Card */
.sub-plan-cta {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  align-self: start;
}

/* Plan Features Wrapper (Row 5 in Subgrid) */
.sub-plan-body {
  display: flex;
  flex-direction: column;
}

.sub-plan-divider {
  height: 1px;
  background-color: var(--border);
  margin-bottom: 16px;
}

.sub-features-head {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 10px;
}

.sub-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--secondary-foreground);
}

.sub-feature-item svg {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.sub-feature-item.is-highlight {
  padding: 9px 10px;
  margin: -2px -4px 2px;
  border-radius: var(--radius-lg);
  background-color: color-mix(in srgb, var(--primary) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  color: var(--foreground);
  font-weight: 500;
}

.sub-feature-item.is-highlight svg {
  color: var(--link);
}

/* Corporate / Enterprise Single Narrow Card (identical geometry to personal cards) */
.sub-enterprise-single {
  display: flex;
  justify-content: center;
}

.sub-enterprise-single > .sub-plan-card {
  width: calc((100% - 48px) / 4);
  min-width: 286px;
  max-width: 340px;
}

/* Comparison Section */
.sub-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.sub-section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 24px;
}

.sub-section-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.sub-section-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted-foreground);
}

.sub-compare-table th:not(:first-child),
.sub-compare-table td:not(:first-child) {
  text-align: center;
}

.sub-compare-table td:first-child {
  font-weight: 500;
  color: var(--foreground);
  min-width: 210px;
}

.sub-compare-table .is-col-featured {
  background-color: color-mix(in srgb, var(--primary) 5%, transparent);
}

.sub-check-yes {
  color: var(--success);
  font-weight: 600;
}

.sub-check-no {
  color: var(--muted-foreground);
  opacity: 0.45;
}

/* FAQ Accordion */
.sub-faq-wrap {
  max-width: 780px;
  margin: 0 auto;
}

.sub-faq-item {
  border-bottom: 1px solid var(--border);
}

.sub-faq-item:last-child {
  border-bottom: 0;
}

.sub-faq-btn {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

.sub-faq-btn:hover {
  background-color: var(--hover-bg);
}

.sub-faq-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  flex-shrink: 0;
  transition: transform var(--duration-base) var(--ease-standard);
}

.sub-faq-btn[aria-expanded="true"] .sub-faq-chevron {
  transform: rotate(180deg);
}

.sub-faq-answer {
  padding: 0 18px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.sub-faq-answer[hidden] {
  display: none;
}

/* Minimalist Login Modal */
.sub-auth-modal {
  max-width: 380px;
}

.sub-auth-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sub-auth-providers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-auth-btn {
  width: 100%;
  height: 40px;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 500;
}

.sub-auth-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.sub-auth-divider {
  height: 1px;
  width: 100%;
  background-color: var(--border);
  margin: 2px 0;
}

.sub-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-phone-input {
  height: 40px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  border-radius: var(--radius-lg);
}

.sub-auth-submit {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 500;
}

.sub-auth-legal {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-align: center;
}

.sub-auth-legal a {
  color: var(--secondary-foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sub-auth-legal a:hover {
  color: var(--foreground);
}

.sub-phone-wait {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: color-mix(in srgb, var(--foreground) 3%, transparent);
}

.sub-phone-wait[hidden] {
  display: none;
}

.sub-phone-wait-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--secondary-foreground);
}

.sub-phone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  flex-shrink: 0;
  animation: subPulse 1.4s ease-in-out infinite;
}

@keyframes subPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Form helpers inside Sales / Checkout Modals */
.sub-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sub-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary-foreground);
}

.sub-textarea {
  appearance: none;
  width: 100%;
  min-height: 82px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background-color: var(--card);
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.48;
  resize: vertical;
}

.sub-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.sub-checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background-color: color-mix(in srgb, var(--foreground) 3.5%, transparent);
  border: 1px solid var(--border);
}

/* Footer */
.sub-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
}

.sub-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted-foreground);
}

.sub-footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sub-footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sub-footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.sub-footer-links a:hover {
  color: var(--foreground);
}

.sub-footer-contacts {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-contact-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  text-decoration: none;
  transition:
    border-color var(--duration-fast) ease,
    background-color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.sub-contact-btn:hover {
  border-color: var(--border-strong);
  background-color: var(--secondary);
  transform: translateY(-1px);
  text-decoration: none;
}

.sub-contact-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Responsive Breakpoints */
@media (max-width: 1120px) {
  .sub-plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .sub-enterprise-single > .sub-plan-card {
    width: min(100%, 340px);
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .sub-nav-inner {
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
  }

  .sub-container {
    padding: 0 16px;
  }

  .sub-nav-links {
    display: none;
  }

  .sub-hero {
    padding: 36px 0 26px;
  }

  .sub-plans-grid,
  .sub-form-grid {
    grid-template-columns: 1fr;
  }

  .sub-plan-desc,
  .sub-price-block {
    min-height: auto;
  }

  .sub-enterprise-single > .sub-plan-card {
    width: 100%;
    max-width: none;
  }

  .sub-audience-toggle > button {
    padding: 0 14px;
    font-size: 13px;
  }
}

.sub-checkout-price {
  font-size: 16px;
}

.sub-select-full {
  width: 100%;
}

.sub-select-full-input {
  width: 100%;
  height: 34px;
}
