/*
 * Profile Section — User account overview and edit layout
 * Built with a Mobile-First approach and pixel fidelity to the Figma designs.
 */

/* ============================ SECTION WRAPPER ============================ */
.profile-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 5rem);
  min-height: calc(100vh - 120px);
}

/* Ambient gradient backdrop (cool blue-grey at top degrading smoothly to subtle mint glow) */
.profile-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 30% 75%, rgba(184, 246, 240, 0.55) 0%, rgba(206, 238, 244, 0.25) 45%, rgba(215, 223, 229, 0) 80%),
    linear-gradient(180deg, #d7dfe5 0%, #dae1e7 18%, #dee5e9 36%, #e5ebef 55%, #e1e9ed 80%, #d5dfe5 100%);
}

/* ============================ LAYOUT (Mobile-First) ============================ */
.profile-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
}

@media (min-width: 1024px) {
  .profile-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: clamp(var(--space-6), 3vw, var(--space-8));
    align-items: start;
  }
}

/* ============================ SIDEBAR ============================ */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.profile-nav-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 40px -20px rgba(38, 48, 47, 0.12), 0 2px 8px -2px rgba(38, 48, 47, 0.04);
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
}

.profile-user-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-user-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eef2f5;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.profile-user-name {
  font-size: 1.25rem;
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  line-height: 1.22;
  margin: 0;
}

/* Navigation List */
.profile-nav {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
}

.profile-nav__link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--color-text-soft);
  font-weight: var(--fw-medium);
  font-size: 0.95rem;
  min-height: 44px; /* Touch target */
  transition: background 200ms ease-out, color 200ms ease-out;
}

.profile-nav__link:hover:not(.is-active) {
  background: rgba(0, 0, 0, 0.035);
  color: var(--color-ink);
}

.profile-nav__link:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

.profile-nav__link.is-active {
  background: #d0e9fa;
  color: var(--color-ink);
  font-weight: var(--fw-semibold);
}

.profile-nav__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.profile-nav__link.is-active .profile-nav__icon {
  stroke: var(--color-ink);
}

/* Logout link inside card */
.profile-nav-card__foot {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
}

.profile-logout-link {
  font-size: 0.95rem;
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: opacity 200ms ease-out, text-underline-offset 200ms ease-out;
}

.profile-logout-link:hover {
  opacity: 0.75;
  text-underline-offset: 5px;
}

.profile-logout-link:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

/* Legal sublinks below card */
.profile-sublinks {
  text-align: center;
  margin-top: 1.25rem;
  font-size: var(--fs-sm);
  color: var(--color-ink);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.profile-sublinks a {
  color: inherit;
  text-decoration: none;
}

.profile-sublinks a:hover {
  text-decoration: underline;
}

/* ============================ MAIN PROFILE CARD ============================ */
.profile-info-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 40px -20px rgba(38, 48, 47, 0.12), 0 2px 8px -2px rgba(38, 48, 47, 0.04);
  padding: clamp(1.5rem, 4vw, 3rem);
}

/* Card Header */
.profile-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}

.profile-card-header__user {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.profile-detail-avatar {
  width: clamp(64px, 8vw, 84px);
  height: clamp(64px, 8vw, 84px);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #eef2f5, 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-card-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 400;
  color: #565656;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.profile-partner-logo {
  height: clamp(28px, 4vw, 38px);
  width: auto;
  max-width: 145px;
  object-fit: contain;
}

/* ============================ FORM GRID ============================ */
.profile-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .profile-form__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.profile-form__col {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Field items */
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-field__label {
  font-size: 0.8125rem;
  color: #6c7273;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

/* View state input */
.profile-field__input {
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.25rem 0;
  width: 100%;
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition), padding var(--transition);
  font-family: inherit;
}

/* Select styling */
select.profile-field__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: default;
}

select.profile-field__input::-ms-expand {
  display: none;
}

/* Editable state */
.is-editing .profile-field__input:not([readonly]) {
  background: #fdfdfd;
  border-color: var(--color-line);
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  font-weight: 500;
}

.is-editing select.profile-field__input:not([disabled]) {
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  background: #fdfdfd;
  border-color: var(--color-line);
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.is-editing .profile-field__input:not([readonly]):focus,
.is-editing select.profile-field__input:not([disabled]):focus {
  border-color: var(--color-muted);
  box-shadow: var(--ring);
}

/* Textarea for professional description */
.profile-field__textarea {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: 0;
  width: 100%;
  resize: none;
  outline: none;
  font-family: inherit;
  min-height: 110px;
  transition: border-color var(--transition), background var(--transition), padding var(--transition);
}

.is-editing .profile-field__textarea:not([readonly]) {
  background: #fdfdfd;
  border-color: var(--color-line);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
}

.is-editing .profile-field__textarea:not([readonly]):focus {
  border-color: var(--color-muted);
  box-shadow: var(--ring);
}

/* Password Row */
.profile-password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-password-mask {
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  color: var(--color-ink);
  font-weight: 700;
  user-select: none;
}

.btn-change-password {
  background: #eef2f5;
  color: #565656;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  transition: background 200ms ease-out, color 200ms ease-out, transform 250ms ease-out, box-shadow 250ms ease-out;
}

.btn-change-password:hover {
  background: #dfe4e6;
  color: var(--color-ink);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-change-password:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

/* ============================ OTROS / TOGGLES ============================ */
.profile-others {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-others__heading {
  font-size: 0.8125rem;
  color: #6c7273;
  font-weight: 400;
  margin: 0;
}

.profile-toggle-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.profile-toggle-item__content {
  flex: 1;
}

.profile-toggle-item__title {
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  margin: 0 0 0.25rem 0;
}

.profile-toggle-item__desc {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #6c7273;
  margin: 0;
}

/* iOS-Style Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #dfe4e6;
  transition: background-color 200ms ease-out;
  border-radius: var(--radius-pill);
}

.switch__slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 200ms ease-out;
  border-radius: 50%;
}

.switch input:checked + .switch__slider {
  background-color: #00a3cc;
}

.switch input:checked + .switch__slider::before {
  transform: translateX(20px);
}

.switch input:disabled + .switch__slider {
  cursor: default;
  opacity: 0.85;
}

.switch input:focus-visible + .switch__slider {
  box-shadow: var(--ring);
}

/* ============================ ACTION BUTTONS ============================ */
.profile-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 2.25rem;
}

.profile-edit-actions:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 560px) {
  .profile-form__actions {
    flex-direction: column-reverse;
    width: 100%;
  }

  .profile-edit-actions:not([hidden]) {
    flex-direction: column-reverse;
    width: 100%;
    gap: 0.75rem;
  }

  .profile-form__actions .btn--profile-edit,
  .profile-form__actions .btn--profile-save,
  .profile-form__actions .btn--profile-cancel {
    width: 100%;
    min-height: 48px;
  }
}

.btn--profile-edit {
  background: var(--color-btn-dark);
  color: var(--color-invert);
  border-radius: 8px;
  padding: 0.75rem 2.25rem;
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 200ms ease-out, transform 250ms ease-out, box-shadow 250ms ease-out;
}

.btn--profile-edit:hover {
  background: color-mix(in srgb, var(--color-btn-dark) 80%, #fff);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.btn--profile-edit:active {
  transform: translateY(1px);
}

.btn--profile-edit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.btn--profile-cancel {
  background: transparent;
  color: #565656;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  min-height: 44px;
  transition: background 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}

.btn--profile-cancel:hover {
  background: #eef2f5;
  color: var(--color-ink);
  border-color: var(--color-muted);
}

.btn--profile-cancel:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.btn--profile-save {
  background: var(--color-btn-dark);
  color: var(--color-invert);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2.25rem;
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  min-height: 44px;
  transition: background 200ms ease-out, transform 250ms ease-out, box-shadow 250ms ease-out;
}

.btn--profile-save:hover {
  background: color-mix(in srgb, var(--color-btn-dark) 80%, #fff);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.btn--profile-save:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

/* Feedback toast */
.profile-feedback {
  margin-bottom: 1.5rem;
}

/* ============================ CHANGE PASSWORD MODAL ============================ */
.change-password-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: modalFadeIn 0.2s ease-out;
}

.change-password-modal-overlay[hidden] {
  display: none !important;
}

.change-password-modal {
  background: var(--color-surface, #ffffff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.change-password-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.change-password-modal__title {
  font-size: 1.35rem;
  font-weight: var(--fw-semibold, 600);
  color: var(--color-ink, #0f172a);
  margin: 0;
}

.change-password-modal__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-muted, #64748b);
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}

.change-password-modal__close:hover {
  color: var(--color-ink, #0f172a);
  background: #f1f5f9;
}

.change-password-modal__alert {
  margin-bottom: 1.25rem;
}

.change-password-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.change-password-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.change-password-form .field__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
}

.change-password-form .field__input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  border: 1px solid var(--color-line, #cbd5e1);
  border-radius: 6px;
  font-size: 0.9375rem;
  outline: none;
  background: #ffffff;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.change-password-form .field__input:focus {
  border-color: var(--color-muted, #0f172a);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.change-password-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ============================ AVATAR TRIGGER & MODAL ============================ */
.profile-avatar-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  /* No hover scale on avatar image per project policy */
}

.profile-avatar-trigger:hover {
  transform: none;
}

.profile-avatar-trigger:focus-visible {
  outline: 2px solid var(--color-ink, #0f172a);
}

.profile-avatar-trigger__badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-ink, #0f172a);
  color: #ffffff;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background var(--transition, 0.2s ease), transform var(--transition, 0.2s ease);
}

.profile-avatar-trigger:hover .profile-avatar-trigger__badge {
  background: #334155;
  transform: scale(1.1);
}

.profile-avatar-trigger--detail .profile-avatar-trigger__badge {
  width: 30px;
  height: 30px;
  right: 0;
  bottom: 0;
}

/* Avatar Modal Dialog */
.profile-avatar-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn 0.2s ease-out;
}

.profile-avatar-modal-overlay[hidden] {
  display: none !important;
}

.profile-avatar-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 1.75rem;
  box-sizing: border-box;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-avatar-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.profile-avatar-modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink, #0f172a);
  margin: 0;
}

.profile-avatar-modal__close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition, 0.2s), background var(--transition, 0.2s);
}

.profile-avatar-modal__close:hover {
  color: var(--color-ink, #0f172a);
  background: #f1f5f9;
}

.profile-avatar-preview-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.profile-avatar-preview {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Dropzone */
.profile-avatar-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: #fafbfc;
  transition: border-color var(--transition, 0.2s), background var(--transition, 0.2s);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.profile-avatar-dropzone:hover,
.profile-avatar-dropzone.is-dragover {
  border-color: var(--color-ink, #0f172a);
  background: #f8fafc;
}

.profile-avatar-dropzone__icon {
  color: #64748b;
  margin-bottom: 0.25rem;
}

.profile-avatar-dropzone__text {
  margin: 0;
  font-size: 0.875rem;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.profile-avatar-dropzone__btn {
  background: none;
  border: none;
  color: var(--color-ink, #0f172a);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  pointer-events: none;
}

.profile-avatar-dropzone__hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Selected File Badge */
.profile-avatar-selected-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #334155;
  margin-bottom: 1.25rem;
}

.profile-avatar-selected-file svg {
  color: #64748b;
  flex-shrink: 0;
}

.profile-avatar-selected-file__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-avatar-remove-selection {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.profile-avatar-remove-selection:hover {
  color: #ef4444;
}

/* Modal Actions */
.profile-avatar-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.profile-avatar-modal__right-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.btn--profile-delete {
  background: transparent;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  padding: 0.65rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition, 0.2s), border-color var(--transition, 0.2s);
}

.btn--profile-delete:hover:not([disabled]) {
  background: #fef2f2;
  border-color: #fca5a5;
}

.btn--profile-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-avatar-modal__actions .btn--profile-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================ CUSTOM CONFIRMATION VIEW ============================ */
.profile-avatar-confirm-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0.5rem 0.5rem;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-avatar-confirm-view[hidden] {
  display: none !important;
}

.profile-avatar-confirm__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.profile-avatar-confirm__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink, #0f172a);
  margin: 0 0 0.5rem 0;
}

.profile-avatar-confirm__desc {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 1.75rem 0;
  max-width: 360px;
}

.profile-avatar-confirm__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.btn--profile-delete-confirm {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #dc2626;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: var(--fw-medium, 500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background var(--transition, 0.2s), border-color var(--transition, 0.2s), transform var(--transition, 0.2s);
}

.btn--profile-delete-confirm:hover:not([disabled]) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn--profile-delete-confirm:active:not([disabled]) {
  transform: translateY(1px);
}

.btn--profile-delete-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================ AVAILABLE COURSES SECTION ============================ */
.profile-courses-content {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  width: 100%;
  min-width: 0;
}

/* Filter Controls Bar */
.profile-courses-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-courses-filter-bar__left,
.profile-courses-filter-bar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-filter-dropdown {
  position: relative;
}

.profile-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  color: var(--color-ink, #1f2937);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-pill, 9999px);
  padding: 0.45rem 1.15rem;
  font-size: 0.875rem;
  font-weight: var(--fw-medium, 500);
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(38, 48, 47, 0.04);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-filter-btn:hover {
  border-color: rgba(0, 0, 0, 0.25);
  background-color: #fafafa;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(38, 48, 47, 0.08);
}

.profile-filter-chevron {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Courses Grid */
.profile-courses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 2vw, 1.75rem);
  width: 100%;
}

@media (min-width: 640px) {
  .profile-courses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .profile-courses-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Course Card */
.available-course-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px -2px rgba(38, 48, 47, 0.06), 0 1px 4px rgba(38, 48, 47, 0.02);
  display: flex;
  flex-direction: column;
  padding: 10px 10px 18px 10px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.available-course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -8px rgba(38, 48, 47, 0.12), 0 4px 12px rgba(38, 48, 47, 0.04);
}

/* Card Media */
.available-course-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 274 / 168;
  border-radius: 14px;
  overflow: hidden;
  background: #0d1b2a;
}

.available-course-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  transition: transform 0.4s ease-out;
}

.available-course-card:hover .available-course-card__img {
  transform: scale(1.04);
}

/* New Badge */
.available-course-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #6ee7b7;
  color: #064e3b;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 5px 12px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.02em;
}

/* Play Button Overlay */
.available-course-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.25s ease-out, background-color 0.25s ease-out, border-color 0.25s ease-out;
  padding: 0;
}

.available-course-card__play svg {
  margin-left: 3px;
  width: 22px;
  height: 22px;
}

.available-course-card:hover .available-course-card__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(0, 0, 0, 0.65);
  border-color: #ffffff;
}

/* Card Body */
.available-course-card__body {
  padding: 14px 8px 0 8px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.available-course-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-ink, #1f2937);
  line-height: 1.35;
  margin: 0 0 8px 0;
}

.available-course-card__desc-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
}

.available-course-card__desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.45;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.available-course-card__desc.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.available-course-card__more-btn,
.available-course-card__more-link {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-ink, #111827);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  line-height: 1.45;
  align-self: flex-start;
  transition: opacity 0.2s ease;
}

.available-course-card__more-btn:hover,
.available-course-card__more-link:hover {
  opacity: 0.75;
}

/* Centered Load More CTA */
.profile-courses-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn--available-courses-more {
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill, 9999px);
  padding: 0.65rem 2.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn--available-courses-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0.92;
}

.btn--available-courses-more:active {
  transform: translateY(0);
}

/* Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .available-course-card,
  .available-course-card__img,
  .available-course-card__play,
  .profile-filter-btn,
  .btn--available-courses-more,
  .profile-certificates-card,
  .profile-certificates-card__img,
  .profile-certificates-card__btn {
    transition: none !important;
    transform: none !important;
  }
}

/* ============================ CERTIFICATES SECTION ============================ */
.profile-info-card--certificates {
  background: var(--color-surface, #ffffff);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 40px -20px rgba(38, 48, 47, 0.12), 0 2px 8px -2px rgba(38, 48, 47, 0.04);
  padding: clamp(1.5rem, 4vw, 3rem);
}

.profile-card-header--certificates {
  margin-bottom: 2.25rem;
}

.profile-certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 300px));
  gap: clamp(1.25rem, 2vw, 1.75rem);
  width: 100%;
}

@media (max-width: 640px) {
  .profile-certificates-grid {
    justify-content: center;
  }
}

/* Certificate Card: 300px x 386px */
.profile-certificates-card {
  width: 300px;
  max-width: 100%;
  min-height: 386px;
  border-radius: 16px;
  border: 1px solid #cdcdcd;
  background: #ffffff59;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 12px 16px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.profile-certificates-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -8px rgba(38, 48, 47, 0.14), 0 4px 12px rgba(38, 48, 47, 0.05);
  border-color: #b5bbbc;
}

/* Card Media */
.profile-certificates-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 274 / 168;
  border-radius: 14px;
  overflow: visible;
}

.profile-certificates-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.4s ease-out;
}

.profile-certificates-card:hover .profile-certificates-card__img {
  transform: scale(1.03);
}

/* Overlapping Badge: 84px x 30px, radius 17px */
.profile-certificates-card__badge {
  position: absolute;
  right: 14px;
  bottom: -15px;
  z-index: 2;
  width: 84px;
  height: 30px;
  border-radius: 17px;
  background: #caebe1;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.profile-certificates-card__badge--mint {
  background: #caebe1;
  color: #000000;
}

.profile-certificates-card__badge--lavender {
  background: #e0e7ff;
  color: #1e1b4b;
}

.profile-certificates-card__badge--amber {
  background: #fef3c7;
  color: #451a03;
}

.profile-certificates-card__badge--peach {
  background: #fed7aa;
  color: #431407;
}

/* Card Body */
.profile-certificates-card__body {
  padding: 22px 4px 4px 4px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.profile-certificates-card__title {
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #555758;
  margin: 0 0 10px 0;
}

.profile-certificates-card__desc {
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0;
  color: #555758;
  margin: 0 0 16px 0;
}

/* Footer & Button: 123px x 40px, radius 22px, bg #8A9091 */
.profile-certificates-card__footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.profile-certificates-card__btn {
  width: 123px;
  height: 40px;
  border-radius: 22px;
  background: #8a9091;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: #ffffff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-certificates-card__btn:hover {
  background: #6e7475;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  color: #ffffff;
}

.profile-certificates-card__btn:active {
  transform: translateY(0);
}

.profile-certificates-card__btn:focus-visible {
  outline: 2px solid #555758;
  outline-offset: 2px;
}


