/* Design tokens for theming */

/* Global tokens (theme-independent) */
:root {
  --font-families-mono: "IBM Plex Mono", "Courier New", Courier, monospace;
  --font-families-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}

/* Dark theme (default) */
:root {
  --border-tertiary: rgba(255, 255, 255, 0.3);
  --border-secondary: #555555;
  --border-primary: #404040;
  --border-active: #666666;
  --text-tertiary: rgba(255, 255, 255, 0.8);
  --text-primary: #e0e0e0;
  --text-faint: rgba(255, 255, 255, 0.4);
  --text-secondary: #b0b0b0;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-subtle: rgba(255, 255, 255, 0.5);
  --background-tertiary: #252525;
  --background-primary: #181818;
  --background-secondary: #2a2a2a;
  --background-active: #333333;
  --background-hover: #333333;
  --accent-magenta: #ff00ff;
  --accent-green: #00ff00;
  --accent-blue: #0066ff;
  --accent-purple: #9900ff;
}

/* Light theme */
:root[data-theme="light"] {
  --border-tertiary: rgba(0, 0, 0, 0.2);
  --border-secondary: #b0b0b0;
  --border-primary: #d0d0d0;
  --border-active: #a0a0a0;
  --text-tertiary: rgba(0, 0, 0, 0.85);
  --text-primary: #1a1a1a;
  --text-faint: rgba(0, 0, 0, 0.45);
  --text-secondary: #333333;
  --text-muted: rgba(0, 0, 0, 0.6);
  --text-subtle: rgba(0, 0, 0, 0.5);
  --background-tertiary: #f0f0f0;
  --background-primary: #ffffff;
  --background-secondary: rgb(234, 234, 234);
  --background-active: #d8d8d8;
  --background-hover: #d8d8d8;
  --accent-magenta: #b000b0;
  --accent-green: #009000;
  --accent-blue: #0052cc;
  --accent-purple: #6600cc;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-families-sans);
  background-color: var(--background-primary);
  color: var(--text-primary);
  min-height: 100vh;
  letter-spacing: 0.02em;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Title bar */
.title-bar {
  height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-primary);
  background-color: var(--background-secondary);
  flex-shrink: 0;
  box-sizing: border-box;
}

.title-bar-left {
  display: flex;
  align-items: center;
}

.title-bar-logo {
  font-family: var(--font-families-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.title-bar-logo:hover {
  color: var(--accent-magenta);
}

.title-bar-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.title-bar-nav a {
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.title-bar-nav a:hover {
  color: var(--text-primary);
}

.title-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.content-container {
  text-align: center;
  max-width: 800px;
}

.content-container h1 {
  font-size: 48px;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.content-container p {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Call-to-action button */
.cta-button {
  display: inline-block;
  margin-top: 32px;
  padding: 16px 32px;
  font-family: var(--font-families-sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--background-primary);
  background-color: var(--accent-magenta);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cta-button:hover {
  background-color: var(--accent-purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 255, 0.3);
}

.cta-button:active {
  transform: translateY(0);
}

/* Footer bar */
.footer-bar {
  height: 100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-top: 1px solid var(--border-primary);
  background-color: var(--background-secondary);
  flex-shrink: 0;
  box-sizing: border-box;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-links a {
  font-family: var(--font-families-sans);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-magenta);
}

/* Loading and error states */
.main-content {
  transition: opacity 0.2s ease;
}

.error-message {
  color: var(--text-primary);
}

.error-message h1 {
  color: var(--accent-magenta);
}

.error-message a {
  color: var(--accent-blue);
  text-decoration: none;
}

.error-message a:hover {
  text-decoration: underline;
}

/* Legal pages (Privacy, Terms) */
.legal-last-updated {
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.legal-content {
  text-align: left;
  max-width: 700px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 24px;
  margin: 32px 0 16px 0;
  color: var(--text-primary);
}

.legal-content h3 {
  font-size: 18px;
  margin: 24px 0 12px 0;
  color: var(--text-primary);
}

.legal-content p {
  margin-bottom: 16px;
  line-height: 1.8;
}

.legal-content ul {
  margin-bottom: 16px;
  margin-left: 24px;
  line-height: 1.8;
}

.legal-content a {
  color: var(--accent-blue);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-back-link {
  text-align: center;
  margin-top: 48px;
}

.legal-notice-box {
  margin: 48px 0;
  padding: 24px;
  background: var(--background-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.legal-notice-box p {
  margin: 0;
  line-height: 1.8;
  font-size: 14px;
}

/* Authentication UI */
.auth-button {
  padding: 8px 16px;
  font-family: var(--font-families-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--background-primary);
  background-color: var(--accent-magenta);
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.auth-button:hover {
  background-color: var(--accent-purple);
  transform: translateY(-1px);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-account-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.user-account-link:hover {
  background-color: var(--background-hover);
  color: var(--text-primary);
}

.user-account-link .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.logout-button {
  padding: 6px 14px;
  font-size: 15px;
  font-family: var(--font-families-sans);
  background-color: var(--background-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.logout-button:hover {
  background-color: var(--background-active);
  border-color: var(--border-active);
  color: var(--text-primary);
}

/* Login form */
.login-container {
  max-width: 400px;
  width: 100%;
}

.login-container h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.login-container > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
}

.form-group input[type="email"] {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--background-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  font-size: 15px;
  color: var(--text-primary);
  font-family: var(--font-families-sans);
  transition: border-color 0.2s ease;
}

.form-group input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-magenta);
}

.form-group input[type="email"]::placeholder {
  color: var(--text-muted);
}

.submit-button {
  width: 100%;
  padding: 12px;
  background-color: var(--accent-magenta);
  color: var(--background-primary);
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-families-sans);
}

.submit-button:hover {
  background-color: var(--accent-purple);
  transform: translateY(-1px);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:disabled {
  background-color: var(--border-secondary);
  cursor: not-allowed;
  transform: none;
}

.message {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: left;
}

.message.success {
  background-color: rgba(0, 255, 0, 0.1);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.message.error {
  background-color: rgba(255, 0, 0, 0.1);
  color: #ff4444;
  border: 1px solid #ff4444;
}

.message.info {
  background-color: rgba(0, 102, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

/* Account page layout */
.account-layout {
  max-width: 900px;
  margin: 48px 0;
}

.account-section.hidden {
  display: none;
}

.account-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border-primary);
}

.account-section:last-of-type {
  border-bottom: none;
}

.account-section-label {
  font-size: 15px;
  color: var(--text-secondary);
  padding-top: 2px;
  font-weight: normal;
}

.account-section-content {
  min-width: 0;
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
}

.account-section-content p {
  font-size: 15px;
  text-align: left;
}

.account-section-content .form-group {
  max-width: 400px;
}

/* Pricing page */
.country-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.country-selector label {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.country-selector select {
  padding: 8px 32px 8px 12px;
  font-family: var(--font-families-sans);
  font-size: 15px;
  color: var(--text-primary);
  background-color: var(--background-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 200px;
}

.country-selector select:hover {
  border-color: var(--border-active);
}

.country-selector select:focus {
  outline: none;
  border-color: var(--accent-magenta);
}

.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
}

.billing-option {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.billing-option.active {
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background-tertiary);
  border: 1px solid var(--border-primary);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-magenta);
  border-color: var(--accent-magenta);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
  background-color: var(--background-primary);
}

.billing-save-badge {
  background: var(--accent-green);
  color: var(--background-primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--background-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 32px;
  position: relative;
  transition: all 0.3s ease;
}

.pricing-card-paid {
  border: 2px solid var(--accent-magenta);
}

.pricing-card-free:hover {
  border-color: var(--border-active);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-magenta);
  color: var(--background-primary);
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
}

.pricing-card-header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 24px;
}

.pricing-card-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.pricing-amount {
  font-size: 48px;
  font-weight: 600;
  color: var(--text-primary);
}

.pricing-period {
  font-size: 16px;
  color: var(--text-secondary);
}

.pricing-annual {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.pricing-card-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
}

.pricing-features li span:last-child {
  flex: 1;
  color: var(--text-primary);
  text-align: left;
}

.pricing-check {
  color: var(--accent-green);
  font-size: 20px;
  flex-shrink: 0;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
}

.pricing-x {
  color: var(--text-muted);
  font-size: 20px;
  flex-shrink: 0;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
}

.pricing-button {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-family: var(--font-families-sans);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.pricing-button-primary {
  background-color: var(--accent-magenta);
  color: var(--background-primary);
}

.pricing-button-primary:hover {
  background-color: var(--accent-purple);
  transform: translateY(-2px);
}

.pricing-button-secondary {
  background-color: var(--background-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-secondary);
}

.pricing-button-secondary:hover {
  background-color: var(--background-active);
  border-color: var(--border-active);
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card-paid {
    order: -1;
  }
}
