:root {
  --primary-color: #14213d;
  --secondary-color: #5f6b7f;
  --highlight-color: #1f7cff;
  --highlight-color-dark: #0b5ed7;
  --cta-gradient: linear-gradient(135deg, #1f7cff 0%, #605dff 100%);
  --light-color: #f5f7fb;
  --card-background: #ffffff;
  --border-color: rgba(20, 33, 61, 0.12);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --transition-speed: 0.3s;
  --text-muted: #6b7b91;
}

body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  background-color: var(--light-color);
  color: var(--primary-color);
}

.account-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.account-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.account-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(31, 124, 255, 0.08);
  color: var(--highlight-color);
  margin-bottom: 16px;
}

.account-section h1 {
  font-size: clamp(2.25rem, 4vw, 2.9rem);
  margin: 0;
  color: var(--primary-color);
}

.account-subtitle {
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 32px;
  margin-top: 48px;
  align-items: start;
}

.account-card {
  background: var(--card-background);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(20, 33, 61, 0.04);
}

.account-details-card {
  display: flex;
  flex-direction: column;
}

.account-actions {
  display: flex;
  flex-direction: column;
}

.account-info {
  display: grid;
  gap: 16px;
  margin-bottom: 12px;
}

.account-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(31, 124, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.account-meta-label {
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--highlight-color);
  font-weight: 600;
}

.account-meta-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-color);
  word-break: break-word;
}

.profile-section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(31, 124, 255, 0) 0%, rgba(31, 124, 255, 0.2) 50%, rgba(31, 124, 255, 0) 100%);
  margin: 28px 0;
}

.profile-photo-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}

.profile-photo-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.profile-photo-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-photo-header strong {
  font-size: 1.05rem;
}

.profile-photo-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-photo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(31, 124, 255, 0.08);
  border: 1px dashed rgba(31, 124, 255, 0.25);
  overflow: hidden;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.profile-photo-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(31, 124, 255, 0.2);
}

#profile-picture {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

#default-profile-icon {
  font-size: 72px;
  color: rgba(31, 124, 255, 0.5);
  transition: color var(--transition-speed) ease;
}

#default-profile-icon:hover {
  color: var(--highlight-color);
}

.profile-picture-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cropped-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(10, 21, 40, 0.7);
}

.cropped-modal-content {
  background: #fff;
  border-radius: 22px;
  width: min(640px, 100%);
  max-height: 90vh;
  padding: 32px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.cropped-modal-content h2 {
  margin: 0;
  font-size: 1.4rem;
}

.cropper-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 33, 61, 0.05);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 280px;
}

.profile-pic-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border: 2px dashed rgba(31, 124, 255, 0.35);
  border-radius: var(--radius-md);
  background: rgba(31, 124, 255, 0.05);
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.profile-pic-preview-wrapper:hover {
  background: rgba(31, 124, 255, 0.1);
  border-color: rgba(31, 124, 255, 0.55);
}

.upload-instructions {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

.cropper-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.cropper-container .cropper-view-box,
.cropper-container .cropper-face {
  border-radius: 50%;
}

img {
  max-width: 100%;
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 32px;
}

.section-heading strong {
  font-size: 1.05rem;
}

.section-heading span {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 65%;
  text-align: right;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.username-section,
.bio-section {
  border-top: 1px solid rgba(20, 33, 61, 0.08);
  padding-top: 24px;
}

.username-section > .subtle-button,
.bio-section > .subtle-button {
  margin-top: 12px;
}

.subtle-button {
  background: transparent;
  color: var(--highlight-color);
  border: 1.5px solid rgba(31, 124, 255, 0.35);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-speed) ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subtle-button:hover,
.subtle-button:focus {
  border-color: var(--highlight-color);
  color: var(--highlight-color);
  box-shadow: 0 8px 20px rgba(31, 124, 255, 0.15);
}

.subtle-button:disabled {
  color: #c4ccd8;
  border-color: rgba(99, 112, 133, 0.2);
  cursor: not-allowed;
  box-shadow: none;
}

.username-form,
.bio-form {
  width: 100%;
  background: rgba(20, 33, 61, 0.03);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.username-form input,
.bio-form textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid rgba(20, 33, 61, 0.15);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  font-family: inherit;
}

.username-form input:focus,
.bio-form textarea:focus {
  outline: none;
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 3px rgba(31, 124, 255, 0.15);
}

.bio-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.error-message {
  color: #d6455f;
  font-size: 0.9rem;
  margin: 0;
}

.account-section .cta-button,
.account-section .secondary-button,
.account-section .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  min-height: 52px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.account-section .cta-button {
  background-image: var(--cta-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 15px 30px rgba(31, 124, 255, 0.25);
}

.account-section .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(31, 124, 255, 0.3);
}

.account-section .secondary-button {
  background: rgba(20, 33, 61, 0.08);
  color: var(--primary-color);
  border: 1px solid rgba(20, 33, 61, 0.12);
}

.account-section .secondary-button:hover {
  background: rgba(20, 33, 61, 0.15);
  transform: translateY(-2px);
}

.account-section .ghost-button {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid rgba(20, 33, 61, 0.15);
}

.account-section .ghost-button:hover {
  color: var(--primary-color);
  border-color: rgba(20, 33, 61, 0.3);
  transform: translateY(-2px);
}

.account-actions h2 {
  margin: 0;
  font-size: 1.45rem;
}

.account-actions-subtitle {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.account-actions-buttons {
  margin-top: 28px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

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

  .account-actions {
    order: -1;
  }
}

@media (max-width: 700px) {
  .account-card {
    padding: 26px;
  }

  .cropped-modal {
    padding: 18px;
  }

  .cropped-modal-content {
    padding: 24px;
    border-radius: 18px;
  }

  .cropper-buttons {
    justify-content: center;
  }

  .profile-photo-section {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-photo-details {
    align-items: center;
    gap: 14px;
  }

  .profile-photo-header {
    align-items: center;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-heading span {
    align-self: flex-start;
    max-width: 100%;
    text-align: left;
  }

  .form-button-group {
    width: 100%;
  }

  .form-button-group button,
  .form-button-group .cta-button {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .account-section {
    padding: 56px 18px 72px;
  }

  .account-section .cta-button,
  .account-section .secondary-button,
  .account-section .ghost-button {
    width: 100%;
  }
}
