/* ===== Reset & Base ===== */
/** { box-sizing: border-box; margin: 0; padding: 0; }*/

/*body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}*/

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: #e5e7eb;
  color: #1f2937;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #d1d5db; }

/* ===== Modal Overlay ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.modal-overlay.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Modal Container ===== */
.modal-container {
  background: #ffffff;
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

/* ===== Header ===== */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px 28px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.modal-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}
.close-btn {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.close-btn:hover { background: #f3f4f6; color: #111827; }

/* ===== Body ===== */
.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

/* ===== Avatar ===== */
.avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.avatar-wrapper {
  position: relative;
  display: inline-block;
}
.avatar-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e5e7eb;
}
.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.avatar-edit-btn:hover { background: #1d4ed8; }

/* ===== Form ===== */
.form-section {
  border: none;
  margin-bottom: 24px;
  padding: 0;
}
.section-label {
  font-weight: 600;
  font-size: 15px;
  color: #374151;
  margin-bottom: 16px;
  display: block;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 8px;
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}
.form-group input,
.form-group select {
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafbfc;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}
.form-group input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.error-msg {
  font-size: 12px;
  color: #ef4444;
  min-height: 18px;
}

/* ===== Toggles ===== */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}
.toggle-label input[type="checkbox"] {
  display: none;
}
.toggle-slider {
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  transition: background 0.25s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle-label input:checked + .toggle-slider {
  background: #2563eb;
}
.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #1f2937;
  color: #fff;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideIn 0.35s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Loader ===== */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ===== Footer ===== */
.modal-footer {
  padding: 16px 28px 24px 28px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  background: #fafbfc;
}