/**
 * Brand Stylesheet for License Management Portal
 * TrendLife / Trend Micro brand reskin.
 *
 * Source of truth: ~/code/checkout/global_src/css/trendlife.css (TrendLife cart
 * reskin) matched against trendlife.com. Uses CSS variables for easy tuning.
 */

/* ---------------- Geist (self-hosted, SIL OFL 1.1) ---------------- */
@font-face {
    font-family: "Geist";
    src: url("../fonts/geist/Geist-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Geist";
    src: url("../fonts/geist/Geist-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Geist";
    src: url("../fonts/geist/Geist-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Geist";
    src: url("../fonts/geist/Geist-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Geist";
    src: url("../fonts/geist/Geist-Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
  /* Brand Colors (TrendLife tokens) */
  --brand-primary: #d71920;          /* trend red — primary / CTA */
  --brand-primary-dark: #bd141a;     /* CTA hover darken */
  --brand-success: #0F6272;          /* dark teal — positive/"resolution" (no green in palette) */
  --brand-error: #d71920;            /* red reserved for errors/concern */
  --brand-warning: #F66F00;          /* brand orange */
  --brand-info: #00859B;             /* sky teal */

  /* Brand literal palette */
  --tl-trend-red: #E31E2D;
  --tl-dark-teal: #0F6272;
  --tl-sky: #00859B;
  --tl-light-teal: #A2D4DF;
  --tl-orange: #F66F00;
  --tl-cream: #F4EFEA;
  --tl-cream-bg: #F5F1ED;
  --tl-warm-100: #FFF8F2;
  --tl-warm-200: #E8D5C8;
  --tl-charcoal: #1A1A1A;
  --tl-grad-ai-warm: linear-gradient(90deg, #d71920 0%, #9B8FFF 100%);

  /* Neutral Colors */
  --bg-main: #F5F1ED;                /* cream page surface */
  --bg-card: #ffffff;
  --text-primary: #1A1A1A;           /* charcoal */
  --text-secondary: #555555;
  --text-muted: #777777;
  --border-color: #E8D5C8;           /* warm-200 */

  /* Typography (Geist everywhere) */
  --font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ls-headline: -0.025em;
  --font-size-base: 16px;
  --font-size-small: 14px;
  --font-size-large: 18px;
  --font-size-xlarge: 24px;
  --line-height: 1.6;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Border Radius */
  --border-radius: 4px;
  --border-radius-large: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font-family);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.card {
  position: relative;
  background-color: var(--bg-card);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}

/* TrendLife gradient accent bar across the top of every card */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--tl-grad-ai-warm);
}

/* Typography */
h1 {
  font-size: var(--font-size-xlarge);
  font-weight: 700;
  letter-spacing: var(--ls-headline);
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary); /* charcoal, matching trendlife.com */
}

h2 {
  font-size: var(--font-size-large);
  font-weight: 600;
  letter-spacing: var(--ls-headline);
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

a {
  color: var(--brand-success); /* dark teal links */
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-info); /* sky teal on hover */
  text-decoration: underline;
}

/* Strong emphasis stays charcoal; red is reserved for CTAs and errors */
strong {
  color: var(--text-primary);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-lg);
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-color: var(--bg-card);
  color: var(--text-primary);
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #bdbdbd; /* neutral focus, per trendlife.css */
  box-shadow: 0 0 0 0.15rem rgba(26, 26, 26, 0.05);
}

input[type="email"].error,
input[type="text"].error {
  border-color: var(--brand-error);
}

/* Buttons — trendlife.com style: pill-shaped, trend red CTA */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) calc(var(--spacing-lg) + 6px);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: var(--font-family);
  text-align: center;
  text-decoration: none;
  border: 3px solid transparent;
  border-radius: 30px; /* pill, matches the TrendLife button theme */
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px; /* Touch-friendly */
  line-height: 1.5;
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background-color: #ffffff;
  border: 3px solid transparent;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--tl-grad-ai-warm) border-box !important; /* gradient-outline pill */
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--brand-primary);
  text-decoration: none;
}

.btn-success {
  background-color: var(--brand-success);
  border-color: var(--brand-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background-color: var(--brand-info);
  border-color: var(--brand-info);
  text-decoration: none;
}

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

.btn-block {
  display: block;
  width: 100%;
}

/* Messages */
.message {
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
  display: none;
}

.message.show {
  display: block;
}

/* Success uses the teal "resolution" palette (the brand has no green) */
.message-success {
  background-color: #EAF4F6;              /* light teal tint */
  border-left: 4px solid var(--brand-success);
  color: var(--tl-dark-teal);
}

.message-error {
  background-color: #FDF0EF;              /* light red tint */
  border-left: 4px solid var(--brand-error);
  color: #7a1b1f;
}

.message-error a {
  color: var(--tl-dark-teal);
}

.message-info {
  background-color: #EAF4F6;
  border-left: 4px solid var(--brand-info);
  color: var(--tl-dark-teal);
}

.message-warning {
  background-color: #FFF3E2;              /* light orange tint */
  border-left: 4px solid var(--brand-warning);
  color: #7a4a00;
}

/* License Key Display */
.license-key-display {
  background-color: var(--bg-main);
  border: 3px solid var(--brand-primary);
  border-radius: var(--border-radius-large);
  padding: var(--spacing-lg);
  text-align: center;
  margin: var(--spacing-lg) 0;
}

.license-key-value {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brand-primary);
  word-break: break-all;
  user-select: all;
}

.license-key-label {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Info Box — soft teal tint (brand "resolution" palette) */
.info-box {
  background-color: #EAF4F6;
  border-left: 4px solid var(--brand-success);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.info-box p {
  margin-bottom: 0;
  color: var(--text-primary);
}

.info-box strong {
  color: var(--tl-dark-teal);
}

/* Loading Spinner */
.loading {
  display: none;
  text-align: center;
  padding: var(--spacing-lg);
}

.loading.show {
  display: block;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: var(--spacing-md);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

/* Header — clean white with the TrendLife horizontal lockup */
.header {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

/* Logo */
.logo {
  height: 40px;           /* matches the TrendLife header lockup height */
  width: auto;
  max-width: 100%;
  margin-bottom: var(--spacing-lg);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.header h1 {
  margin-bottom: var(--spacing-sm);
}

.header p {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--spacing-lg) 0;
  color: var(--text-muted);
  font-size: var(--font-size-small);
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-xl);
}

.footer a {
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--brand-primary);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 600px) {
  .container {
    padding: var(--spacing-md);
  }

  .card {
    padding: var(--spacing-lg);
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: var(--font-size-base);
  }

  .license-key-value {
    font-size: 16px;
  }
}
