/* Change Password page – matches developskriv.se/profil/ design */

.chpw-container {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin: 0 auto;
}

/* ========================================
   Two-column header
   ======================================== */
.chpw-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.chpw-header-left {
  background: #5a8f8f;
  border-radius: 8px;
  padding: clamp(32px, 6vw, 48px);
  min-height: clamp(140px, 20vw, 180px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.chpw-header-left h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px 0;
}

.chpw-header-left p {
  font-size: 15px;
  color: #fff;
  margin: 0;
  line-height: 1.5;
}

.chpw-header-right {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  min-height: clamp(140px, 20vw, 180px);
  padding: clamp(32px, 6vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
}

.chpw-header-right h2 {
  font-size: 26px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.chpw-header-right p {
  font-size: 17px;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

.chpw-help-btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background-color: #003D4E;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s;
  align-self: flex-start;
}

.chpw-help-btn:hover {
  background-color: #00506a;
  color: #fff;
}

/* ========================================
   Form card
   ======================================== */
.chpw-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chpw-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin: 0 0 24px 0;
}

/* ========================================
   Form fields
   ======================================== */
.chpw-field {
  margin-bottom: 20px;
}

.chpw-field-full {
  width: 100%;
}

.chpw-field label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #555;
  margin-bottom: 8px;
}

.chpw-field label .required {
  color: #e74c3c;
}

.chpw-field input[type="password"],
.chpw-field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.chpw-field input:focus {
  border-color: #003D4E;
}

/* Field header with label + show password */
.chpw-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chpw-field-header label {
  margin-bottom: 0;
}

.chpw-show-password {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #003D4E;
  padding: 0;
}

.chpw-show-password svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.chpw-show-password:hover {
  color: #00506a;
}

/* Two-column row for new + confirm */
.chpw-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Tip text */
.chpw-tip {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
  margin: 10px 0 30px 0;
}

/* ========================================
   Action buttons
   ======================================== */
.chpw-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chpw-btn-primary {
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background-color: #003D4E;
  border: 1px solid #003D4E;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
  line-height: 1;
}

.chpw-btn-primary:hover {
  background-color: #00506a;
}

.chpw-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chpw-btn-secondary {
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  line-height: 1;
  text-decoration: none;
}

.chpw-btn-secondary:hover {
  border-color: #999;
}

/* ========================================
   Messages
   ======================================== */
.chpw-message {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.chpw-message.error {
  display: block;
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.chpw-message.success {
  display: block;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

/* Spinner */
.chpw-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: chpw-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes chpw-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .chpw-header {
    grid-template-columns: 1fr;
  }

  .chpw-field-row {
    grid-template-columns: 1fr;
  }

  .chpw-card {
    padding: 24px;
  }

  .chpw-actions {
    flex-direction: column;
  }

  .chpw-btn-primary,
  .chpw-btn-secondary {
    width: 100%;
    text-align: center;
  }
}