/* ==========================================================================
   Profile Page — Futuristic Neumorphic Design
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Page Layout
   --------------------------------------------------------------------------- */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 900px;
  width: 100%;
}

/* ---------------------------------------------------------------------------
   Profile Header
   --------------------------------------------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
  background-color: var(--color-bg-primary);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-raised-lg);
  transition: box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-header__avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-header__avatar {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-accent);
  overflow: hidden;
  box-shadow: var(--neu-raised);
}

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

.profile-header__avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  cursor: pointer;
  box-shadow: var(--neu-raised);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-header__avatar-edit:hover {
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  color: var(--color-text-on-accent);
  box-shadow: var(--neu-raised-sm);
}

.profile-header__info {
  flex: 1;
  min-width: 0;
}

.profile-header__name {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.profile-header__role {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.profile-header__email {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-placeholder);
  margin-top: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Profile Form Section
   --------------------------------------------------------------------------- */
.profile-section {
  background-color: var(--color-bg-primary);
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--neu-raised);
  transition: box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-section:hover {
  box-shadow: var(--neu-raised-lg);
}

.profile-section__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
}

.profile-section__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
}

.profile-section__title {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
}

.profile-section__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  border-radius: var(--radius-full);
}

.profile-section__body {
  padding: var(--space-6);
}

/* ---------------------------------------------------------------------------
   Personal Info Form
   --------------------------------------------------------------------------- */
.profile-form {
  max-width: 100%;
}

.profile-form__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.profile-form__row:last-child {
  margin-bottom: 0;
}

.profile-form__row--single {
  grid-template-columns: 1fr;
}

/* ---------------------------------------------------------------------------
   Password Change Section
   --------------------------------------------------------------------------- */
.password-section {
  background-color: var(--color-bg-primary);
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--neu-raised);
  transition: box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.password-section:hover {
  box-shadow: var(--neu-raised-lg);
}

.password-section__header {
  position: relative;
  padding: var(--space-5) var(--space-6);
}

.password-section__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
}

.password-section__title {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
}

.password-section__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  border-radius: var(--radius-full);
}

.password-section__description {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-tertiary);
  margin-top: var(--space-1);
  padding-left: var(--space-4);
  line-height: 1.5;
}

.password-section__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Password strength indicator */
.password-strength {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.password-strength__bars {
  display: flex;
  gap: var(--space-1);
}

.password-strength__bar {
  flex: 1;
  height: 3px;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  box-shadow: var(--neu-inset-sm);
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.password-strength__bar--filled {
  background-color: var(--color-error);
  box-shadow: none;
}

.password-strength--medium .password-strength__bar--filled {
  background-color: var(--color-warning);
  box-shadow: none;
}

.password-strength--strong .password-strength__bar--filled {
  background-color: var(--color-success);
  box-shadow: none;
}

.password-strength__label {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-placeholder);
}

.password-strength--weak .password-strength__label {
  color: var(--color-error-text);
}

.password-strength--medium .password-strength__label {
  color: var(--color-warning-text);
}

.password-strength--strong .password-strength__label {
  color: var(--color-success-text);
}

/* ---------------------------------------------------------------------------
   Session / Security Info
   --------------------------------------------------------------------------- */
.profile-sessions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.session-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: none;
  background-color: var(--color-bg-primary);
  box-shadow: var(--neu-raised);
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.session-item:hover {
  box-shadow: var(--neu-raised-lg);
}

.session-item--current {
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  box-shadow: var(--neu-raised-lg);
}

.session-item--current .session-item__device,
.session-item--current .session-item__details,
.session-item--current .session-item__icon {
  color: var(--color-text-on-accent);
}

.session-item__icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.session-item__info {
  flex: 1;
  min-width: 0;
}

.session-item__device {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}

.session-item__details {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-placeholder);
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .profile-page {
    max-width: 100%;
  }
}

@media (max-width: 639px) {
  .profile-page {
    gap: var(--space-6);
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-5);
  }

  .profile-section__header {
    padding: var(--space-4);
  }

  .profile-section__body {
    padding: var(--space-4);
  }

  .profile-form__row {
    grid-template-columns: 1fr;
  }

  .password-section__header {
    padding: var(--space-4);
  }

  .password-section__body {
    padding: var(--space-4);
  }
}
