/* ============================================
   Auth Pages - Shared styles for login, register,
   account, profile, and other authenticated pages.
   ============================================ */

/* Auth Page Layout */
.studio-a .auth-page { padding-block: clamp(40px,6vw,88px); }
.studio-a .auth-container { max-width: 520px; }
.studio-a .auth-card { border-radius: 14px; box-shadow: var(--shadow); padding: clamp(24px,4vw,44px); }
.studio-a .auth-title { font-size: clamp(30px,3vw,42px); font-weight: 600; letter-spacing: -.025em; text-align: left; }
.studio-a .auth-subtitle { text-align: left; }
.studio-a .form-group :is(input,textarea,select) { font-family: inherit; border-width: 1px; min-height: 48px; }
.studio-a .account-page { padding-block: clamp(36px,5vw,72px); }
.studio-a .account-page > .container > h1 { margin-bottom: 32px; }
.studio-a .auth-page .btn, .studio-a .account-page .btn { min-height: 48px; }

.auth-page {
  min-height: calc(100vh - var(--header-height, 64px) - 200px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--page-bg-alt, #f5f7fa);
}

.auth-container {
  width: 100%;
  max-width: 480px;
}

.auth-card {
  background: #ffffff;
  border-radius: var(--radius-lg, 12px);
  padding: 2.5rem;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary, #1a1a2e);
}

.auth-subtitle {
  color: var(--text-secondary, #555);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

/* Notices */
.auth-notice {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-notice--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-notice--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-notice--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a2e);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1.5px solid var(--border-color, #e0e0e0);
  border-radius: var(--radius-md, 8px);
  background: #ffffff;
  color: var(--text-primary, #1a1a2e);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent, #4537d4);
  box-shadow: 0 0 0 3px var(--accent-light, rgba(69, 55, 212, 0.15));
}

.form-group input::placeholder {
  color: var(--text-muted, #888);
}

.form-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Password strength meter */
.password-strength {
  height: 4px;
  border-radius: 2px;
  background: var(--border-color, #e0e0e0);
  margin-top: 0.25rem;
  overflow: hidden;
}

.password-strength__bar {
  height: 100%;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.password-strength__bar[data-score="0"] { width: 5%; background: #ef4444; }
.password-strength__bar[data-score="1"] { width: 25%; background: #ef4444; }
.password-strength__bar[data-score="2"] { width: 50%; background: #f59e0b; }
.password-strength__bar[data-score="3"] { width: 75%; background: #10b981; }
.password-strength__bar[data-score="4"] { width: 100%; background: #059669; }

.password-strength__text {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  color: var(--text-muted, #888);
}

/* Auth links */
.auth-link {
  font-size: 0.875rem;
  color: var(--accent, #4537d4);
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary, #555);
  margin-top: 1.5rem;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted, #888);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e0e0e0);
}

/* Google button */
.btn--google {
  background: #ffffff;
  color: #333;
  border: 1.5px solid var(--border-color, #e0e0e0);
  font-weight: 600;
}

.btn--google:hover {
  background: #f8f9fa;
  border-color: #ccc;
  color: #333;
}

.btn--google svg {
  flex-shrink: 0;
}

/* Button modifiers for auth pages */
.btn--full {
  width: 100%;
}

.btn--small {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn--danger {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.btn--danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* ============================================
   Account Page
   ============================================ */

.account-page {
  padding: 2.5rem 1.5rem;
  min-height: calc(100vh - var(--header-height, 64px) - 200px);
}

.account-page .container {
  max-width: 960px;
  margin: 0 auto;
}

.account-page h1 {
  margin-bottom: 1.5rem;
}

/* Tab Navigation */
.account-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color, #e0e0e0);
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.account-tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary, #555);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.account-tab:hover {
  color: var(--text-primary, #1a1a2e);
}

.account-tab--active {
  color: var(--accent, #4537d4);
  border-bottom-color: var(--accent, #4537d4);
  font-weight: 600;
}

/* Account Content */
.account-content {
  background: #ffffff;
  border-radius: var(--radius-lg, 12px);
  padding: 2rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.account-content h2 {
  margin-bottom: 1rem;
}

.account-content h3 {
  margin-bottom: 0.75rem;
}

/* Welcome section */
.welcome-section p {
  color: var(--text-secondary, #555);
  margin-bottom: 1.5rem;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--page-bg-alt, #f5f7fa);
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent, #4537d4);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary, #555);
}

/* Products list */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: var(--radius-md, 8px);
}

.product-info h3 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.activation-code {
  font-size: 0.875rem;
  background: var(--page-bg-alt, #f5f7fa);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm, 4px);
  /* impeccable-disable-next-line design-system-font -- license keys are literal code, not display typography */
  font-family: 'Consolas', 'Monaco', monospace;
}

.no-license {
  font-size: 0.875rem;
  color: var(--text-muted, #888);
  font-style: italic;
}

/* Activations */
.activation-section {
  margin-bottom: 2rem;
}

.activation-section h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-light, #e8e6f8);
  color: var(--accent, #4537d4);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.activations-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.activations-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 2px solid var(--border-color, #e0e0e0);
  font-weight: 600;
  color: var(--text-secondary, #555);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.activations-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  color: var(--text-primary, #1a1a2e);
}

.activations-table tr:last-child td {
  border-bottom: none;
}

.activations-table code {
  font-size: 0.8125rem;
  background: var(--page-bg-alt, #f5f7fa);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm, 4px);
}

/* Security section */
.security-section {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.security-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.twofa-setup ol {
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary, #555);
  font-size: 0.9375rem;
}

.twofa-setup ol li {
  margin-bottom: 0.5rem;
}

.qr-code {
  text-align: center;
  margin-bottom: 1.5rem;
}

.qr-code img {
  margin: 0 auto;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color, #e0e0e0);
}

/* Profile */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: var(--text-secondary, #555);
  width: 140px;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.info-value {
  color: var(--text-primary, #1a1a2e);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .auth-page {
    padding: 2rem 1rem;
  }

  .auth-card {
    padding: 1.75rem 1.5rem;
  }

  .account-page {
    padding: 1.5rem 1rem;
  }

  .account-tabs {
    gap: 0;
  }

  .account-tab {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .account-content {
    padding: 1.5rem;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .product-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .activations-table {
    display: block;
    overflow-x: auto;
  }

  .info-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .info-label {
    width: auto;
  }
}
