/* =========================================================
   account.css — Dashboard, Profile, Billing, License pages
   Design system: Cormorant Garamond / Libre Baskerville
   ========================================================= */

/* Account layout */
.account-page {
  background: #FAFAF9;
  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: #ffffff;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: sticky;
  top: 5rem;
}

.account-nav-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e7e5e4;
}

.account-nav-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #0C0A09;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-nav-email {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.6875rem;
  color: #78716c;
  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: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  color: #44403C;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
  cursor: pointer;
}

.account-nav-link:hover {
  background: #FAFAF9;
  color: #1C1917;
}

.account-nav-link.active {
  background: rgba(202, 138, 4, 0.08);
  color: #92400e;
  font-weight: 700;
}

.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: #e7e5e4;
  margin: 0.375rem 0;
}

.account-nav-signout {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 1.25rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  color: #b91c1c;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.account-nav-signout:hover {
  background: #fef2f2;
}

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

.account-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.875rem;
  font-weight: 600;
  color: #0C0A09;
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

/* Cards */
.account-card {
  background: #ffffff;
  border: 1px solid rgba(28, 25, 23, 0.1);
  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 #e7e5e4;
}

.account-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0C0A09;
  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: 20px;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge.active {
  background: #f0fdf4;
  color: #15803d;
}

.status-badge.grace {
  background: #fffbeb;
  color: #92400e;
}

.status-badge.expired, .status-badge.cancelled {
  background: #fef2f2;
  color: #b91c1c;
}

.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: 'Libre Baskerville', serif;
}

.subscription-meta-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.subscription-meta-value {
  font-size: 0.9375rem;
  color: #0C0A09;
}

/* 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 #f0efee;
  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: #f0efee;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-name {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0C0A09;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-meta {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.75rem;
  color: #78716c;
  margin-top: 0.1rem;
}

.device-counter {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8125rem;
  color: #44403C;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #f0efee;
}

/* 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: #FAFAF9;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.quick-action:hover {
  background: #ffffff;
  border-color: rgba(28, 25, 23, 0.2);
  transform: translateY(-2px);
}

.quick-action-label {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0C0A09;
}

.quick-action-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.75rem;
  color: #78716c;
  line-height: 1.4;
}

/* Buttons */
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8125rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

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

.btn-primary-sm {
  background: #1C1917;
  color: #ffffff;
}

.btn-primary-sm:hover {
  background: #0C0A09;
}

.btn-danger-sm {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger-sm:hover {
  background: #fee2e2;
}

.btn-ghost-sm {
  background: transparent;
  color: #44403C;
  border: 1px solid rgba(28, 25, 23, 0.2);
}

.btn-ghost-sm:hover {
  background: #f0efee;
}

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

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e7e5e4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  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;
}

.profile-avatar-initials {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #44403C;
}

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

.profile-form .form-field label {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1C1917;
  display: block;
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

.profile-form input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.9375rem;
  color: #0C0A09;
  background: #FAFAF9;
  border: 1px solid rgba(28, 25, 23, 0.25);
  border-radius: 3px;
  outline: none;
  transition: border-color 150ms ease;
  box-sizing: border-box;
}

.profile-form input:focus {
  border-color: #CA8A04;
  background: #ffffff;
}

.profile-section-divider {
  border: none;
  border-top: 1px solid #e7e5e4;
  margin: 1.75rem 0;
}

.danger-zone {
  padding: 1rem 1.5rem;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff8f8;
  margin-top: 0.5rem;
}

.danger-zone-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #b91c1c;
  margin: 0 0 0.375rem;
}

.danger-zone-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.8125rem;
  color: #78716c;
  margin: 0 0 0.875rem;
  line-height: 1.5;
}

/* Billing table */
.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
}

.billing-table th {
  text-align: left;
  padding: 0.5rem 0.875rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e7e5e4;
}

.billing-table td {
  padding: 0.875rem;
  color: #0C0A09;
  border-bottom: 1px solid #f0efee;
  vertical-align: middle;
}

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

.billing-table a {
  color: #CA8A04;
  text-decoration: underline;
  cursor: pointer;
}

.billing-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  color: #78716c;
}

/* 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: 'Libre Baskerville', serif;
  font-size: 0.9375rem;
  color: #0C0A09;
  background: #FAFAF9;
  border: 1px solid rgba(28, 25, 23, 0.25);
  border-radius: 3px;
  outline: none;
  transition: border-color 150ms ease;
  letter-spacing: 0.05em;
}

.license-input:focus {
  border-color: #CA8A04;
  background: #ffffff;
}

.license-current {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-family: 'Libre Baskerville', serif;
}

.license-current-key {
  font-family: monospace;
  font-size: 0.9375rem;
  color: #0C0A09;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.license-current-meta {
  font-size: 0.8125rem;
  color: #44403C;
}

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

.download-hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.25rem;
  font-weight: 600;
  color: #0C0A09;
  margin: 0 0 0.5rem;
}

.download-hero-sub {
  font-family: 'Libre Baskerville', serif;
  font-size: 1rem;
  color: #44403C;
}

.download-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.platform-card {
  background: #ffffff;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 4px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.platform-card.detected {
  border-color: #CA8A04;
  box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.15);
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(28, 25, 23, 0.08);
}

.platform-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: #44403C;
}

.platform-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0C0A09;
  margin-bottom: 0.25rem;
}

.platform-version {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.75rem;
  color: #78716c;
  margin-bottom: 1rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  background: #CA8A04;
  border: none;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.btn-download:hover {
  background: #a16207;
  transform: translateY(-2px);
}

.platform-card:not(.detected) .btn-download {
  background: #1C1917;
}

.platform-card:not(.detected) .btn-download:hover {
  background: #0C0A09;
}

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

.detected-label {
  display: inline-block;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 0.1rem 0.5rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.system-requirements {
  background: #ffffff;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  color: #44403C;
}

.system-requirements h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #0C0A09;
  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(12, 10, 9, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

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

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0C0A09;
  margin: 0 0 0.5rem;
}

.modal-body {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.875rem;
  color: #44403C;
  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, #f0efee 25%, #e7e5e4 50%, #f0efee 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: 3px;
  }

  .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;
  }
}
