/* =============================================================
 * QRConnect MiniMax Component Library
 * -------------------------------------------------------------
 * All classes are prefixed `.mm-` to avoid clashing with Tailwind utilities
 * or legacy `style.css` / `tailwind-custom.css` definitions.
 *
 * Load order:
 *   1) design-tokens.css   (variables)
 *   2) Tailwind CDN script
 *   3) mm-components.css   (this file)
 *
 * Include into a page only when you are ready to switch that page to the
 * MiniMax design. Linking this file alone does not visually change pages
 * that still use legacy classes (no global resets or overrides here).
 * ============================================================= */

/* ============================================================
 * 1. Base resets — scoped, not global
 * Apply by giving body the class `.mm-canvas` (used only on renewed pages).
 * ============================================================ */
.mm-canvas {
  font-family: var(--mm-font-body);
  color: var(--mm-ink);
  background-color: var(--mm-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.mm-canvas *,
.mm-canvas *::before,
.mm-canvas *::after {
  box-sizing: border-box;
}

/* ============================================================
 * 2. Typography
 * ============================================================ */
.mm-hero-display {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-hero);
  font-weight: 600;
  line-height: var(--mm-lh-hero);
  letter-spacing: var(--mm-ls-hero);
  color: var(--mm-ink);
}

/* Latin-only override: when the whole element is English/digits */
.mm-hero-display[lang="en"],
.mm-hero-display.is-latin {
  font-size: 80px;
  letter-spacing: -2px;
  line-height: 1.10;
}

.mm-display-lg {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-display-lg);
  font-weight: 600;
  line-height: var(--mm-lh-display);
  letter-spacing: var(--mm-ls-display-lg);
  color: var(--mm-ink);
}

.mm-heading-lg {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-heading-lg);
  font-weight: 600;
  line-height: var(--mm-lh-heading-lg);
  letter-spacing: var(--mm-ls-heading-lg);
  color: var(--mm-ink);
}

.mm-heading-md {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-heading-md);
  font-weight: 600;
  line-height: var(--mm-lh-heading);
  letter-spacing: var(--mm-ls-heading-md);
  color: var(--mm-ink);
}

.mm-heading-sm {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-heading-sm);
  font-weight: 600;
  line-height: var(--mm-lh-heading);
  color: var(--mm-ink);
}

.mm-card-title {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-card-title);
  font-weight: 600;
  line-height: var(--mm-lh-card-title);
  color: var(--mm-ink);
}

.mm-subtitle {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-subtitle);
  font-weight: 500;
  line-height: var(--mm-lh-subtitle);
  color: var(--mm-steel);
}

.mm-body-md {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-body-md);
  font-weight: 400;
  line-height: var(--mm-lh-body);
  color: var(--mm-charcoal);
}

.mm-body-md-bold {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-body-md);
  font-weight: 700;
  line-height: var(--mm-lh-body);
  color: var(--mm-ink);
}

.mm-body-sm {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-body-sm);
  font-weight: 400;
  line-height: var(--mm-lh-body);
  color: var(--mm-charcoal);
}

.mm-body-sm-medium {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-body-sm);
  font-weight: 500;
  line-height: var(--mm-lh-body);
  color: var(--mm-ink);
}

.mm-caption {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-caption);
  font-weight: 400;
  line-height: 1.70;
  color: var(--mm-stone);
}

.mm-caption-bold {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-caption);
  font-weight: 600;
  line-height: 1.50;
  color: var(--mm-ink);
}

.mm-micro {
  font-family: var(--mm-font-body);
  font-size: var(--mm-fs-micro);
  font-weight: 400;
  line-height: 1.50;
  color: var(--mm-muted);
}

/* ============================================================
 * 3. Buttons — every button is a pill (rounded-full)
 * Hover states intentionally omitted per MiniMax no-hover policy.
 * Active/pressed handled via :active for tactile feedback only.
 * ============================================================ */
.mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 11px 24px;
  font-family: var(--mm-font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.40;
  border-radius: var(--mm-r-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--mm-dur-fast) var(--mm-ease),
              color var(--mm-dur-fast) var(--mm-ease),
              border-color var(--mm-dur-fast) var(--mm-ease);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.mm-btn:focus-visible {
  outline: 2px solid var(--mm-brand-blue-deep);
  outline-offset: 2px;
}

.mm-btn:disabled,
.mm-btn[aria-disabled="true"] {
  background-color: var(--mm-hairline);
  color: var(--mm-muted);
  border-color: transparent;
  cursor: not-allowed;
}

/* Primary: black pill — the dominant CTA */
.mm-btn-primary {
  background-color: var(--mm-primary);
  color: var(--mm-on-primary);
}

.mm-btn-primary:active {
  background-color: var(--mm-charcoal);
}

/* Secondary: outlined pill */
.mm-btn-secondary {
  background-color: transparent;
  color: var(--mm-ink);
  border-color: var(--mm-ink);
}

.mm-btn-secondary:active {
  background-color: var(--mm-surface);
}

/* Tertiary: white pill with hairline border — Google login, quiet CTA */
.mm-btn-tertiary {
  background-color: var(--mm-canvas);
  color: var(--mm-ink);
  border-color: var(--mm-hairline);
}

.mm-btn-tertiary:active {
  background-color: var(--mm-surface);
}

/* Link: inline text link styled as button */
.mm-btn-link {
  background-color: transparent;
  color: var(--mm-ink);
  padding: 8px 0;
  font-size: var(--mm-fs-body-sm);
  font-weight: 500;
  border: none;
}

.mm-btn-link:active {
  text-decoration: underline;
}

/* Icon-circular: 36x36 utility button */
.mm-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: var(--mm-canvas);
  color: var(--mm-ink);
  border-color: var(--mm-hairline);
}

/* Full-width modifier */
.mm-btn-block {
  display: flex;
  width: 100%;
}

/* Large variant for hero CTAs */
.mm-btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* ============================================================
 * 4. Cards
 * Quiet 16px round for documentation/standard cards.
 * 32px round for vibrant product cards.
 * ============================================================ */
.mm-card {
  background-color: var(--mm-canvas);
  border-radius: var(--mm-r-xl);
  padding: var(--mm-s-xl);
  border: 1px solid var(--mm-hairline);
}

.mm-card-feature {
  background-color: var(--mm-surface);
  border-radius: var(--mm-r-xl);
  padding: var(--mm-s-xxl);
}

.mm-card-recommendation {
  background-color: var(--mm-canvas);
  border-radius: var(--mm-r-lg);
  padding: var(--mm-s-lg);
  border: 1px solid var(--mm-hairline);
}

.mm-ai-product-tile {
  background-color: var(--mm-canvas);
  border-radius: var(--mm-r-xxxl);
  padding: var(--mm-s-xl);
  border: 1px solid var(--mm-hairline);
}

/* Vibrant product cards — the signature 32px round */
.mm-product-card {
  border-radius: var(--mm-r-hero);
  padding: var(--mm-s-xxl);
  color: var(--mm-on-dark);
  display: flex;
  flex-direction: column;
  gap: var(--mm-s-md);
  min-height: 280px;
}

.mm-product-card--coral   { background-color: var(--mm-brand-coral); }
.mm-product-card--magenta { background-color: var(--mm-brand-magenta); }
.mm-product-card--blue    { background-color: var(--mm-brand-blue); }
.mm-product-card--purple  { background-color: var(--mm-brand-purple); }
.mm-product-card--photo   { background-color: var(--mm-primary); }
.mm-product-card--ink     { background-color: var(--mm-primary); }   /* MiniMax 시그니처 ink black — 4개 use-case 카드 통일용 */

/* Promo CTA card — full-width coral with embedded white pill */
.mm-promo-cta-card {
  background-color: var(--mm-brand-coral);
  color: var(--mm-on-dark);
  border-radius: var(--mm-r-hero);
  padding: var(--mm-s-section);
}

/* ============================================================
 * 5. Inputs & Forms
 * ============================================================ */
.mm-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 12px 16px;
  background-color: var(--mm-canvas);
  color: var(--mm-ink);
  font-family: var(--mm-font-body);
  font-size: 16px;
  line-height: 1.50;
  border: 1px solid var(--mm-hairline);
  border-radius: var(--mm-r-md);
  transition: border-color var(--mm-dur-fast) var(--mm-ease),
              box-shadow var(--mm-dur-fast) var(--mm-ease);
}

.mm-input::placeholder {
  color: var(--mm-stone);
}

.mm-input:focus {
  outline: none;
  border-color: var(--mm-brand-blue-deep);
  border-width: 2px;
  padding: 11px 15px; /* compensate +1px border to avoid layout shift */
}

.mm-input.is-error,
.mm-input[aria-invalid="true"] {
  border-color: var(--mm-error);
}

.mm-input--lg {
  height: 48px;
  padding-block: 14px;
}

.mm-input--lg:focus {
  padding-block: 13px;
}

/* Mobile touch target uplift */
@media (max-width: 767px) {
  .mm-input { height: 44px; }
  .mm-btn   { padding-block: 14px; }
}

.mm-search-pill {
  height: 36px;
  padding: 8px 16px;
  background-color: var(--mm-surface);
  color: var(--mm-steel);
  font-size: 14px;
  border: 1px solid var(--mm-hairline);
  border-radius: var(--mm-r-md);
}

.mm-form-error {
  display: block;
  margin-top: 4px;
  color: var(--mm-error);
  font-size: 13px;
  line-height: 1.50;
}

/* Stacked form group — inputs share a wrapper with hairline dividers */
.mm-form-stack {
  border: 1px solid var(--mm-hairline);
  border-radius: var(--mm-r-xl);
  overflow: hidden;
  background-color: var(--mm-canvas);
}

.mm-form-stack > .mm-input {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--mm-hairline);
  height: 48px;
}

.mm-form-stack > .mm-input:last-child {
  border-bottom: none;
}

.mm-form-stack > .mm-input:focus {
  border-bottom-color: var(--mm-brand-blue-deep);
  box-shadow: inset 0 -1px 0 0 var(--mm-brand-blue-deep);
  padding: 12px 16px;
}

/* ============================================================
 * 6. Tabs
 * ============================================================ */
.mm-tab-segmented {
  background-color: transparent;
  color: var(--mm-steel);
  font-family: var(--mm-font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 16px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.mm-tab-segmented[aria-selected="true"] {
  color: var(--mm-ink);
  border-bottom-color: var(--mm-ink);
}

.mm-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--mm-canvas);
  color: var(--mm-steel);
  font-family: var(--mm-font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--mm-hairline);
  border-radius: var(--mm-r-full);
  cursor: pointer;
  transition: background-color var(--mm-dur-fast) var(--mm-ease),
              color var(--mm-dur-fast) var(--mm-ease);
}

.mm-pill-tab[aria-selected="true"],
.mm-pill-tab.is-active {
  background-color: var(--mm-primary);
  color: var(--mm-on-primary);
  border-color: var(--mm-primary);
}

/* ============================================================
 * 7. Badges
 * ============================================================ */
.mm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-family: var(--mm-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.40;
  border-radius: var(--mm-r-full);
  white-space: nowrap;
}

.mm-badge--success { background-color: var(--mm-success-bg); color: var(--mm-success-text); }
.mm-badge--new     { background-color: var(--mm-brand-coral); color: var(--mm-on-dark); }
.mm-badge--beta    { background-color: var(--mm-brand-blue-200); color: var(--mm-brand-blue-deep); }
.mm-badge--code {
  background-color: var(--mm-brand-blue-200);
  color: var(--mm-brand-blue-deep);
  border-radius: var(--mm-r-sm);
  padding: 2px 6px;
  font-family: var(--mm-font-mono);
}

/* ============================================================
 * 8. Promo banner — sticky black strip above the top nav
 * ============================================================ */
.mm-promo-banner {
  background-color: var(--mm-primary);
  color: var(--mm-on-primary);
  font-family: var(--mm-font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  text-align: center;
}

.mm-promo-banner a {
  color: var(--mm-on-primary);
  text-decoration: underline;
  margin-left: 4px;
}

/* ============================================================
 * 9. Top navigation — marketing variant
 * ============================================================ */
.mm-top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--mm-canvas);
  height: 64px;
  border-bottom: 1px solid var(--mm-hairline-soft);
}

.mm-top-nav__inner {
  max-width: var(--mm-container-max);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mm-top-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mm-ink);
  text-decoration: none;
  font-family: var(--mm-font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mm-top-nav__brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--mm-r-md);
  background-color: var(--mm-primary);
  color: var(--mm-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mm-top-nav__links {
  display: none;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 1024px) {
  .mm-top-nav__links { display: inline-flex; }
}

.mm-top-nav__link {
  color: var(--mm-charcoal);
  text-decoration: none;
  font-family: var(--mm-font-body);
  font-size: 14px;
  font-weight: 500;
}

.mm-top-nav__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 767px) {
  .mm-top-nav { height: 56px; }
  .mm-top-nav__inner { padding: 0 16px; }
}

/* ============================================================
 * 10. Footer — dense black multi-column
 * ============================================================ */
.mm-footer {
  background-color: var(--mm-footer-bg);
  color: var(--mm-on-dark);
  padding: var(--mm-s-section) var(--mm-s-xxl);
  font-family: var(--mm-font-body);
}

.mm-footer__inner {
  max-width: var(--mm-container-max);
  margin: 0 auto;
  display: grid;
  gap: var(--mm-s-xxl);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .mm-footer__inner {
    grid-template-columns: 1.5fr repeat(4, 1fr);
  }
}

.mm-footer__brand h3 {
  font-family: var(--mm-font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mm-footer__brand p {
  color: var(--mm-muted);
  font-size: 14px;
  line-height: 1.65;
}

.mm-footer__col-title {
  color: var(--mm-on-dark);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.mm-footer__link {
  display: block;
  color: var(--mm-muted);
  font-size: 14px;
  line-height: 1.50;
  padding: 4px 0;
  text-decoration: none;
}

/* ============================================================
 * 11. Sections (marketing rhythm)
 * ============================================================ */
.mm-section {
  padding: var(--mm-s-hero) var(--mm-s-xxl);
}

.mm-section--tight {
  padding: var(--mm-s-section-lg) var(--mm-s-xxl);
}

.mm-section__inner {
  max-width: var(--mm-container-max);
  margin: 0 auto;
}

@media (max-width: 767px) {
  .mm-section,
  .mm-section--tight {
    padding: var(--mm-s-section-lg) var(--mm-s-md);
  }
}

/* ============================================================
 * 12. Hero band — centered display + dual CTA
 * ============================================================ */
.mm-hero-band {
  text-align: center;
  padding: var(--mm-s-hero) var(--mm-s-xxl);
}

.mm-hero-band__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--mm-surface);
  border: 1px solid var(--mm-hairline);
  border-radius: var(--mm-r-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--mm-steel);
  margin-bottom: 24px;
}

.mm-hero-band__title {
  margin-bottom: 24px;
}

.mm-hero-band__subtitle {
  max-width: 640px;
  margin: 0 auto 40px;
}

.mm-hero-band__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
 * 13. Product matrix grid (4-col, horizontal scroll < 1024)
 * ============================================================ */
.mm-product-matrix {
  display: grid;
  gap: var(--mm-s-md);
  grid-template-columns: 1fr;
}

@media (min-width: 640px)  { .mm-product-matrix { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mm-product-matrix { grid-template-columns: repeat(4, 1fr); } }

/* AI Product Matrix below the vibrant cards */
.mm-ai-matrix {
  display: grid;
  gap: var(--mm-s-md);
  grid-template-columns: 1fr;
}

@media (min-width: 480px)  { .mm-ai-matrix { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .mm-ai-matrix { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .mm-ai-matrix { grid-template-columns: repeat(4, 1fr); } }

/* ============================================================
 * 14. Stat row (testimonial-stat-row)
 * ============================================================ */
.mm-stat-row {
  display: grid;
  gap: var(--mm-s-xl);
  grid-template-columns: 1fr;
  text-align: center;
}

@media (min-width: 640px) { .mm-stat-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mm-stat-row { grid-template-columns: repeat(4, 1fr); } }

.mm-stat-row__value {
  font-family: var(--mm-font-display);
  font-size: var(--mm-fs-heading-lg);
  font-weight: 600;
  color: var(--mm-ink);
  line-height: 1.20;
}

.mm-stat-row__label {
  font-size: 14px;
  color: var(--mm-steel);
  margin-top: 8px;
}

/* ============================================================
 * 15. Auth shell — used by login/signup/reset
 * ============================================================ */
.mm-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--mm-canvas);
}

.mm-auth-shell__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.mm-auth-card {
  width: 100%;
  max-width: 480px;
}

.mm-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mm-stone);
  font-size: 13px;
  margin: 24px 0;
}

.mm-auth-divider::before,
.mm-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--mm-hairline);
}

/* ============================================================
 * 16. Modal shell — used in dashboard renewal
 * ============================================================ */
.mm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(10, 10, 10, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mm-modal {
  background-color: var(--mm-canvas);
  border-radius: var(--mm-r-xxl);
  padding: var(--mm-s-xxl);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--mm-elev-4);
}

@media (max-width: 767px) {
  .mm-modal-backdrop { padding: 0; align-items: flex-end; }
  .mm-modal {
    max-width: none;
    max-height: 90vh;
    border-radius: var(--mm-r-xxl) var(--mm-r-xxl) 0 0;
  }
}
