/* =========================================================
   account.css — Dashboard, Profile, Billing, License pages
   Design system: Newsreader / Instrument Sans (2026 brand)
   ========================================================= */

/* Account layout */
.account-page {
  background: var(--clr-bg, #F5EFE3);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
}

.account-container {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Sidebar nav */
.account-nav {
  background: #FBF7EE;
  border: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
  border-radius: 4px;
  overflow: hidden;
  position: sticky;
  top: 5rem;
}

.account-nav-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
}

.account-nav-name {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--clr-primary, #211A12);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-nav-email {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.6875rem;
  color: var(--clr-text-muted, #6E6353);
  margin: 0.15rem 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-nav-links {
  padding: 0.5rem 0;
}

.account-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.875rem;
  color: var(--clr-secondary, #4A4136);
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
  cursor: pointer;
}

.account-nav-link:hover {
  background: rgba(33, 26, 18, 0.05);
  color: var(--clr-primary, #211A12);
}

.account-nav-link.active {
  background: rgba(166, 58, 43, 0.08);
  color: var(--clr-accent, #A63A2B);
  font-weight: 600;
}

.account-nav-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.7;
}

.account-nav-link.active svg {
  opacity: 1;
}

.account-nav-divider {
  height: 1px;
  background: var(--clr-border, rgba(33, 26, 18, 0.16));
  margin: 0.375rem 0;
}

.account-nav-signout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.875rem;
  color: var(--clr-fail, #9C2B1D);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.account-nav-signout:hover {
  background: rgba(156, 43, 29, 0.06);
}

/* Main content area */
.account-main {
  min-width: 0;
}

.account-heading {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.875rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--clr-primary, #211A12);
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

/* Cards */
.account-card {
  background: #FBF7EE;
  border: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
  border-radius: 4px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
}

.account-card-title {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--clr-primary, #211A12);
  margin: 0;
}

.account-card-body {
  padding: 1.25rem 1.5rem;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge.active {
  background: rgba(47, 93, 80, 0.1);
  color: var(--clr-success, #2F5D50);
}

.status-badge.grace {
  background: rgba(166, 58, 43, 0.1);
  color: var(--clr-accent-dk, #7E2C20);
}

.status-badge.expired, .status-badge.cancelled {
  background: rgba(156, 43, 29, 0.1);
  color: var(--clr-fail, #9C2B1D);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Subscription card */
.subscription-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.subscription-meta-item {
  font-family: var(--font-body, 'Newsreader', Georgia, serif);
}

.subscription-meta-label {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--clr-text-muted, #6E6353);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.subscription-meta-value {
  font-size: 0.9375rem;
  color: var(--clr-primary, #211A12);
}

/* Devices list */
.devices-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid rgba(33, 26, 18, 0.08);
  gap: 1rem;
}

.device-item:last-child {
  border-bottom: none;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.device-icon {
  width: 36px;
  height: 36px;
  background: var(--clr-bg-warm, #EDE5D4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-name {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clr-primary, #211A12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-meta {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.75rem;
  color: var(--clr-text-muted, #6E6353);
  margin-top: 0.1rem;
}

.device-counter {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.8125rem;
  color: var(--clr-secondary, #4A4136);
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid rgba(33, 26, 18, 0.08);
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.875rem;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--clr-bg, #F5EFE3);
  border: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.quick-action:hover {
  background: var(--clr-bg-warm, #EDE5D4);
  border-color: rgba(33, 26, 18, 0.28);
  transform: translateY(-2px);
}

.quick-action-label {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clr-primary, #211A12);
}

.quick-action-desc {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.75rem;
  color: var(--clr-text-muted, #6E6353);
  line-height: 1.4;
}

/* Buttons */
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.btn-sm:hover {
  transform: translateY(-2px);
}

.btn-primary-sm {
  background: var(--clr-accent, #A63A2B);
  color: #F3ECDD;
}

.btn-primary-sm:hover {
  background: var(--clr-accent-lt, #B94434);
}

.btn-danger-sm {
  background: rgba(156, 43, 29, 0.08);
  color: var(--clr-fail, #9C2B1D);
  border: 1px solid rgba(156, 43, 29, 0.3);
}

.btn-danger-sm:hover {
  background: rgba(156, 43, 29, 0.14);
}

.btn-ghost-sm {
  background: transparent;
  color: var(--clr-secondary, #4A4136);
  border: 1px solid rgba(33, 26, 18, 0.28);
}

.btn-ghost-sm:hover {
  background: var(--clr-bg-warm, #EDE5D4);
}

/* Profile form */
.profile-form {
  max-width: 480px;
}

/* The photo and its requirements, side by side — the hint has to be readable
   while choosing a file, not tucked under the control. */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.profile-avatar-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.profile-avatar-hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--clr-muted, #7A6E5D);
}

.profile-avatar-hint--error {
  color: #9C2B1D;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--clr-bg-warm, #EDE5D4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: opacity 150ms ease;
}

.profile-avatar:hover {
  opacity: 0.85;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* `hidden` has to win over the flex display the frame's children would
   otherwise take, or the empty <img> sits on top of the initial. */
.profile-avatar [hidden] {
  display: none !important;
}

.profile-avatar-initials {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--clr-secondary, #4A4136);
}

.profile-form .form-field {
  margin-bottom: 1.125rem;
}

.profile-form .form-field label {
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--clr-primary, #211A12);
  display: block;
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

.profile-form input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.9375rem;
  color: var(--clr-primary, #211A12);
  background: var(--clr-bg, #F5EFE3);
  border: 1px solid rgba(33, 26, 18, 0.25);
  border-radius: 3px;
  outline: none;
  transition: border-color 150ms ease;
  box-sizing: border-box;
}

.profile-form input:focus {
  border-color: var(--clr-accent, #A63A2B);
  background: #FBF7EE;
}

.profile-section-divider {
  border: none;
  border-top: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
  margin: 1.75rem 0;
}

.danger-zone {
  padding: 1rem 1.5rem;
  border: 1px solid rgba(156, 43, 29, 0.3);
  border-radius: 4px;
  background: rgba(156, 43, 29, 0.05);
  margin-top: 0.5rem;
}

.danger-zone-title {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--clr-fail, #9C2B1D);
  margin: 0 0 0.375rem;
}

.danger-zone-desc {
  font-family: var(--font-body, 'Newsreader', Georgia, serif);
  font-size: 0.8125rem;
  color: var(--clr-text-muted, #6E6353);
  margin: 0 0 0.875rem;
  line-height: 1.5;
}

/* Billing table */
.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.875rem;
}

.billing-table th {
  text-align: left;
  padding: 0.5rem 0.875rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--clr-text-muted, #6E6353);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
}

.billing-table td {
  padding: 0.875rem;
  color: var(--clr-primary, #211A12);
  border-bottom: 1px solid rgba(33, 26, 18, 0.08);
  vertical-align: middle;
}

.billing-table tr:last-child td {
  border-bottom: none;
}

.billing-table a {
  color: var(--clr-accent, #A63A2B);
  text-decoration: underline;
  cursor: pointer;
}

.billing-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  font-family: var(--font-body, 'Newsreader', Georgia, serif);
  font-size: 0.875rem;
  color: var(--clr-text-muted, #6E6353);
}

/* License key input */
.license-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.license-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-family: var(--font-mono, 'Spline Sans Mono', monospace);
  font-size: 0.9375rem;
  color: var(--clr-primary, #211A12);
  background: var(--clr-bg, #F5EFE3);
  border: 1px solid rgba(33, 26, 18, 0.25);
  border-radius: 3px;
  outline: none;
  transition: border-color 150ms ease;
  letter-spacing: 0.05em;
}

.license-input:focus {
  border-color: var(--clr-accent, #A63A2B);
  background: #FBF7EE;
}

.license-current {
  background: rgba(47, 93, 80, 0.08);
  border: 1px solid rgba(47, 93, 80, 0.3);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
}

.license-current-key {
  font-family: var(--font-mono, 'Spline Sans Mono', monospace);
  font-size: 0.9375rem;
  color: var(--clr-primary, #211A12);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.license-current-meta {
  font-size: 0.8125rem;
  color: var(--clr-secondary, #4A4136);
}

/* Download page */
.download-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.download-hero-title {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 2.25rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--clr-primary, #211A12);
  margin: 0 0 0.5rem;
}

.download-hero-sub {
  font-family: var(--font-body, 'Newsreader', Georgia, serif);
  font-size: 1rem;
  color: var(--clr-secondary, #4A4136);
}

.download-platforms {
  display: grid;
  /* 280px, not 240px: with four platforms the narrower track fits exactly
     three across the account column, orphaning ChromeOS alone on a second
     row. 280px settles into a balanced 2x2 there, and still opens out to
     four abreast once the viewport is wide enough to hold them. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.platform-card {
  background: #FBF7EE;
  border: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
  border-radius: 4px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.platform-card.detected {
  border-color: var(--clr-accent, #A63A2B);
  box-shadow: 0 0 0 2px rgba(166, 58, 43, 0.15);
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(33, 26, 18, 0.08);
}

.platform-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--clr-secondary, #4A4136);
}

.platform-name {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--clr-primary, #211A12);
  margin-bottom: 0.25rem;
}

.platform-version {
  font-family: var(--font-mono, 'Spline Sans Mono', monospace);
  font-size: 0.75rem;
  color: var(--clr-text-muted, #6E6353);
  margin-bottom: 1rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: #F3ECDD;
  background: var(--clr-accent, #A63A2B);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.btn-download:hover {
  background: var(--clr-accent-lt, #B94434);
  transform: translateY(-2px);
}

.platform-card:not(.detected) .btn-download {
  background: var(--clr-primary, #211A12);
}

.platform-card:not(.detected) .btn-download:hover {
  background: var(--clr-bg-dark, #0F0C0A);
}

.btn-download--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.detected-label {
  display: inline-block;
  font-family: var(--font-ui, 'Instrument Sans', sans-serif);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--clr-accent-dk, #7E2C20);
  background: rgba(166, 58, 43, 0.1);
  border: 1px solid rgba(166, 58, 43, 0.3);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.system-requirements {
  background: #FBF7EE;
  border: 1px solid var(--clr-border, rgba(33, 26, 18, 0.16));
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-body, 'Newsreader', Georgia, serif);
  font-size: 0.875rem;
  color: var(--clr-secondary, #4A4136);
}

.system-requirements h3 {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--clr-primary, #211A12);
  margin: 0 0 0.875rem;
}

.system-requirements ul {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.8;
}

/* Delete confirmation modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 10, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #FBF7EE;
  border-radius: 4px;
  padding: 1.75rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(15, 12, 10, 0.2);
}

.modal-title {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--clr-primary, #211A12);
  margin: 0 0 0.5rem;
}

.modal-body {
  font-family: var(--font-body, 'Newsreader', Georgia, serif);
  font-size: 0.875rem;
  color: var(--clr-secondary, #4A4136);
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #EDE5D4 25%, #E5DBC7 50%, #EDE5D4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 3px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .account-container {
    grid-template-columns: 1fr;
  }

  .account-nav {
    position: static;
  }

  .account-nav-links {
    display: flex;
    flex-wrap: wrap;
    padding: 0.375rem;
    gap: 0.25rem;
  }

  .account-nav-link {
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
  }

  .account-nav-divider {
    display: none;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .license-input-row {
    flex-direction: column;
  }

  .download-platforms {
    grid-template-columns: 1fr;
  }
}
