/* Account page styles (reuses website theme variables from styles.css) */

.account-hero {
  padding: 48px 0 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
}

.account-hero h1 {
  font-size: 36px;
  color: var(--text);
  margin-bottom: 8px;
}

.account-hero .subtitle {
  font-size: 16px;
  color: var(--text-light);
  max-width: 720px;
}

.account-shell {
  padding: 24px 0 56px;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 0.4fr;
  gap: 20px;
}

.account-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}

.account-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

@media (max-width: 900px) {
  .account-layout {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }
}

.account-sections {
  align-self: start;
  position: sticky;
  top: 92px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 900px) {
  .account-sections {
    top: 72px;
    flex-direction: row;
    align-items: center;
    padding: 10px;
    gap: 10px;
  }

  .section-links {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.section-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font: inherit;
}

.section-link.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}

.account-section {
  scroll-margin-top: 96px;
}

@media (min-width: 901px) {
  .account-section.desktop-section-hidden {
    display: none !important;
  }
}

.section-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 900px) {
  .section-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }
}

@media (max-width: 520px) {
  .account-sections {
    position: static;
    top: auto;
    padding: 10px;
  }

  .section-links {
    padding-bottom: 4px;
  }

  .section-link {
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 800;
  }

  .section-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.account-loading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-loading-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--secondary);
  animation: spinner-rotate 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.account-card h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text);
}

.oauth-block {
  margin: 14px 0 6px;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.oauth-divider span {
  color: var(--text-light);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.oauth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oauth-provider {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.oauth-apple {
  width: 100%;
}

.oauth-hint {
  margin-top: 10px;
}

.account-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

@media (max-width: 520px) {
  .account-row {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}

.account-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.account-meta .label {
  font-size: 12px;
  color: var(--text-light);
}

.account-meta .value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-row .value {
  flex: 1;
}

.status-row .btn-small {
  padding: 10px 12px;
}

.status-row .password-toggle {
  width: 40px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.avatar {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0;
  align-self: center;
}

@media (min-width: 700px) {
  .avatar {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 520px) {
  .avatar {
    align-self: flex-start;
  }
}

@media (min-width: 700px) {
  .avatar {
    width: 112px;
    height: 112px;
    border-radius: 24px;
  }
}

@media (min-width: 1100px) {
  .avatar {
    width: 136px;
    height: 136px;
    border-radius: 28px;
  }
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar .initials {
  font-weight: 700;
  color: var(--text-light);
  font-size: 22px;
}

@media (min-width: 700px) {
  .avatar .initials {
    font-size: 28px;
  }
}

@media (min-width: 1100px) {
  .avatar .initials {
    font-size: 32px;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--text-light);
}

.field input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-row input {
  flex: 1;
}

.field-row .btn-small {
  padding: 12px 14px;
  white-space: nowrap;
}

.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 44px;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.password-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.password-toggle[data-state="hidden"] .password-toggle__icon--hide {
  display: none;
}

.password-toggle[data-state="shown"] .password-toggle__icon--show {
  display: none;
}

.field input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(61, 125, 202, 0.15);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.avatar-dropzone {
  border: 1.5px dashed var(--border);
  background: var(--bg);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avatar-dropzone:hover {
  border-color: rgba(61, 125, 202, 0.55);
}

.avatar-dropzone:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(61, 125, 202, 0.15);
}

.avatar-dropzone.dragover {
  border-color: var(--secondary);
  background: rgba(61, 125, 202, 0.08);
}

.avatar-dropzone-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.avatar-dropzone-hint {
  font-size: 13px;
  color: var(--text-light);
}

.avatar-dropzone-meta {
  font-size: 12px;
  color: var(--text-light);
}

.avatar-dropzone-preview {
  margin-top: 8px;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.modal {
  width: min(560px, 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crop-stage {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0f0f0f;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.crop-stage canvas {
  width: 100%;
  height: auto;
  display: block;
}

.crop-frame {
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    0 0 0 9999px rgba(0, 0, 0, 0.10);
  pointer-events: none;
}

.crop-controls {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.crop-controls input[type="range"] {
  flex: 1;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary-small {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary-small {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-danger-small {
  background: #FF3B30;
  color: #fff;
}

.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-entitlement {
  background: var(--primary);
  color: #2A2A2A;
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .btn-entitlement {
  border-color: rgba(255, 255, 255, 0.08);
}

.entitlements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

@media (min-width: 700px) {
  .entitlements-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.entitlement-tile {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="dark"] .entitlement-tile {
  background: rgba(255, 255, 255, 0.03);
}

.tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tile-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.tile-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.tile-status {
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-light);
  white-space: nowrap;
}

[data-theme="dark"] .tile-status {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

.tile-status.status-ok {
  border-color: rgba(52, 199, 89, 0.35);
  background: rgba(52, 199, 89, 0.12);
  color: #34C759;
}

.tile-status.status-info {
  border-color: rgba(90, 159, 232, 0.35);
  background: rgba(90, 159, 232, 0.14);
  color: var(--secondary);
}

.tile-status.status-warn {
  border-color: rgba(255, 203, 5, 0.40);
  background: rgba(255, 203, 5, 0.14);
  color: var(--primary);
}

.tile-status.status-muted {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-light);
}

[data-theme="dark"] .tile-status.status-muted {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.tile-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tile-body {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
}

.notice.verify {
  border-left-color: rgba(160, 160, 160, 0.85);
  border-color: rgba(160, 160, 160, 0.35);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .notice.verify {
  border-left-color: rgba(160, 160, 160, 0.75);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.verify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-light);
}

.inline-msg.success {
  color: rgba(52, 199, 89, 0.92);
  font-weight: 600;
}

.inline-msg.error {
  color: #FF3B30;
  font-weight: 600;
}

.support-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.muted {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.5;
}

.notice {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: rgba(0, 0, 0, 0.02);
  color: var(--text);
  font-size: 13px;
}

[data-theme="dark"] .notice {
  background: rgba(255, 255, 255, 0.03);
}

/* Notice variants (used for auth + profile feedback) */
.notice.error {
  border-color: rgba(255, 59, 48, 0.55);
  border-left-color: rgba(255, 59, 48, 0.9);
  background: rgba(255, 59, 48, 0.10);
}

[data-theme="dark"] .notice.error {
  border-color: rgba(255, 59, 48, 0.70);
  border-left-color: rgba(255, 59, 48, 1);
  background: rgba(255, 59, 48, 0.16);
}

.notice.success {
  border-color: rgba(52, 199, 89, 0.55);
  border-left-color: rgba(52, 199, 89, 0.95);
  background: rgba(52, 199, 89, 0.10);
}

[data-theme="dark"] .notice.success {
  border-color: rgba(52, 199, 89, 0.70);
  border-left-color: rgba(52, 199, 89, 1);
  background: rgba(52, 199, 89, 0.14);
}

.hidden {
  display: none !important;
}

.danger-zone {
  margin-top: 36px;
}

.danger-card {
  border-color: rgba(255, 59, 48, 0.45);
  background: rgba(255, 59, 48, 0.05);
}

[data-theme="dark"] .danger-card {
  border-color: rgba(255, 59, 48, 0.60);
  background: rgba(255, 59, 48, 0.10);
}

.danger-card h2 {
  color: #FF3B30;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
